What would be the nice way to make the following action:
List<IEnumerable<T>> listOfEnumerables = Get...();
List<T> listOfObjects = new List<T>();
// I want 'listOfObjects' to contain every element from every enumerable
// in 'listOfEnumerables'.
Is there any beautiful way to make this instead of the following:
foreach (var enumerable in listOfEnumerables)
{
listOfObjects.AddRange(enumerable);
}
Thank you.
You can use LINQ: