How to merge a collection of collections in Linq

Try

var it = GetTheNestedCase();
return it.SelectMany(x => x);

SelectMany is a LINQ transformation which essentially says “For Each Item in a collection return the elements of a collection”. It will turn one element into many (hence SelectMany). It’s great for breaking down collections of collections into a flat list.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)