У меня есть[code]Items[/code] table with columns [code]Id[/code], [code]Code[/code] and [code]Amount[/code]. There is an in-memory collection that has Code-Phase value pairs: [code]T100 - 1[/code], [code]L100 - 1[/code], [code]T200 - 2[/code]... multiple codes can map to same phase number. Getting the totals per code is simple. [code] var totals = db.Items.GroupBy(x => x.Code) .Select(x => new { Code = x.Key, Total = x.Sum(y => y.Amount), }); [/code] Is it possible to have a query in EF that finds the total amounts by phase number? I know that combining in memory collections and EF [code]IQuerable[/code] is not possible in general. I was hoping to do this without converting the DbSet to [code]IEnumerable[/code].