An overview of grouping collections with LINQ in .NET
November 14, 2016 Leave a comment
Introduction
The LINQ GroupBy operator is one of the most powerful ones among all LINQ operators. It helps us group elements in a collection in various ways and lets us control the element and result selection process. However, with its many overloads and Func parameters the GroupBy operator can be a bit difficult to understand at first. At least it is more complex than say the Min() and Max() LINQ operators.
This post will go through the GroupBy operator and many of its overloads with a number of examples.