-
Notifications
You must be signed in to change notification settings - Fork 1
Grouping
Hendrik Bulens edited this page Jul 21, 2021
·
3 revisions
List<Customer> customers = new()
{
new Customer(1, "Jeff", "New York"),
new Customer(2, "Harvey", "Los Angeles"),
new Customer(3, "Donald", "New York"),
new Customer(4, "Megan", "Toronto"),
new Customer(5, "Frank", "New York"),
};
List<IGrouping<object, Customer>> groups = customers.GroupByMany(x => x.Name, x => x.Address).ToList();
int groupCount = groups.Count // 5