I have a LINQ query which returns IEnumerable
but i want to return only >
List
so i want to merge all my record in
If you have a List<List<int>> k
you can do
List<int> flatList= k.SelectMany( v => v).ToList();
Try SelectMany()
var result = iList.SelectMany( i => i );
Like this?
var iList = Method().SelectMany(n => n);
iList.SelectMany(x => x).ToArray()
With query syntax:
var values =
from inner in outer
from value in inner
select value;