У меня есть
Код: Выделить всё
ItemsКод: Выделить всё
IdКод: Выделить всё
CodeКод: Выделить всё
AmountThere is an in-memory collection that has Code-Phase value pairs:
Код: Выделить всё
T100 - 1Код: Выделить всё
L100 - 1Код: Выделить всё
T200 - 2Getting the totals per code is simple.
Код: Выделить всё
var totals = db.Items.GroupBy(x => x.Code)
.Select(x => new
{
Code = x.Key,
Total = x.Sum(y => y.Amount),
});
I know that combining in memory collections and EF
Код: Выделить всё
IQuerableКод: Выделить всё
IEnumerableИсточник: https://stackoverflow.com/questions/781 ... collection