I need to do the following, I have a List with a class which contains 2 integer id and count
List
Now I want to do the following linq query:
Group the items by Id and then sum the Counts in each group:
Id
Count
var result = items.GroupBy(x => x.Id) .Select(g => new { Id = g.Key, Sum = g.Sum(x => x.Count) });