3 ms·
The specific example in this article reminds me why I like C# so much. var newlist = mylist.GroupBy(i => i.thing).Select(g => new { thing = g.Key,
by grandpoobah 5y ago
The specific example in this article reminds me why I like C# so much.
var newlist = mylist.GroupBy(i => i.thing).Select(g => new {
thing = g.Key,
count = g.Sum(i => i.count),
}).ToList();