Flatten List in LINQ

前端 未结 5 1796
独厮守ぢ
独厮守ぢ 2020-11-22 08:47

I have a LINQ query which returns IEnumerable> but i want to return only List so i want to merge all my record in

5条回答
  •  抹茶落季
    2020-11-22 09:06

    If you have a List> k you can do

    List flatList= k.SelectMany( v => v).ToList();
    

提交回复
热议问题