GroupBy
The LINQ operator that splits a sequence into groups sharing a key, each group carrying its key and its own items.
In more detail
items.GroupBy(p => p.Category) yields one group per category, in the order the keys were first seen. Each group is itself a sequence you can count or sum.
Related terms
- LINQ — Language Integrated Query: a set of C# operators such as Where, Select and OrderBy for filtering, shaping and combining sequences of data.
Taught in
- Collections, Generics, and LINQ — Modern .NET Core, C# & Enterprise Microservices