GroupBy is an easy way to sort a IEnumerable<T> collection of items into distinct groups.
Simple Example
In this first example, we end up with two groups, odd and even items.
List<int> iList = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
var grouped = iList.GroupBy(x => x ...