Group by in LINQ

Absolutely – you basically want: Or as a non-query expression: Basically the contents of the group (when viewed as an IEnumerable<T>) is a sequence of whatever values were in the projection (p.car in this case) present for the given key. For more on how GroupBy works, see my Edulinq post on the topic. (I’ve renamed … Read more