Давайте сделаем это следующим образом:
var groupPart = from erb in _context.ENotesReadBies
where erb.ReadByUId == 1173 && erb.Read
group erb by new { erb.ENoteId, erb.ReadByUId, erb.Read } into grouped
select new
{
grouped.Key.ENoteId,
grouped.Key.ReadByUId,
grouped.Key.Read
};
var result = from e in _context.ENotes
join g in groupPart
on e.ENoteId equals g.ENoteId into gJ
from g in gJ.DefaultIfEmpty()
select new
{
ENote = e,
g.ENoteId,
g.ReadByUId,
g.Read
};
var materializedResult = result.ToList();
Если вы запустите этот код и профилируете его сгенерированный запрос sql, вы получите:
SELECT [e].[ENoteId], [e].[Name], [t].[ENoteId], [t].[ReadByUId], [t].[Read]
FROM [ENotes] AS [e]
LEFT JOIN (
SELECT [e0].[ENoteId], [e0].[ReadByUId], [e0].[Read]
FROM [ENotesReadBies] AS [e0]
WHERE ([e0].[ReadByUId] = CAST(1173 AS bigint)) AND ([e0].[Read] = CAST(1 AS bit))
GROUP BY [e0].[ENoteId], [e0].[ReadByUId], [e0].[Read]
) AS [t] ON [e].[ENoteId] = [t].[ENoteId]
это то же самое, что вы хотите;)