>>foreach (var group in groups) >>{ >> foreach (var item in group) >> { >> //process item. >> } >>} >>>>
var people = new List<Person>(); people.Add(new Person { FirstName = "John", LastName = "Doe" }); people.Add(new Person { FirstName = "Jane", LastName = "Doe" }); people.Add(new Person { FirstName = "Bob", LastName = "Barker" }); people.Add(new Person { FirstName = "Billy", LastName = "Barker" }); people.Add(new Person { FirstName = "Billy", LastName = "Bob" });I'd like to get a collection with 3 elements. Element 1 will be a collection of people (the Does), Element 2 will be a collection of people (The Barkers), Element 3 will be a collection with Billy Bob.