score:13

Accepted answer

It's as simple as SelectMany:

Projects each element of a sequence to an IEnumerable and flattens the resulting sequences into one sequence.

var kids = people.SelectMany(p => p.Kids);

(If you want a List<Kid> instead of an IEnumerable<Kid>, just call .ToList() on the result.)

score:4

You can use the SelectMany extension method

var kids = new List(people.SelectMany(person => person.Kids));

score:3

A "LINQ-non-lambda-style" version of SelectMany:

var allKids = 
  from p in people
  from k in p.Kids  // secondary "from" makes SelectMany (aka flat map)
  select k;

// Result from above is IEnumerable, to Force evaluation as a List:
List<Kid> allKidsList = allKids.ToList();

Related Articles