How do I Aggregate multiple IEnumerables of T

后端 未结 5 1779
春和景丽
春和景丽 2021-02-12 18:20

Given....

Public MasterList as IEnumerable(Of MasterItem)
Public Class MasterItem(Of T) 
    Public SubItems as IEnumerable(Of T)
End Class 

I

5条回答
  •  青春惊慌失措
    2021-02-12 19:06

    You can achieve this by Linq with SelectMany

    C# Code

    masterLists.SelectMany(l => l.SubItems);
    


    Best Regards

提交回复
热议问题