由于....
Public MasterList as IEnumerable(Of MasterItem)
Public Class MasterItem(Of T)
Public SubItems as IEnumerable(Of T)
End Class
我想一个单一的IEnumerable(Of T)中,将遍历所有MasterItems的MasterList所有子项
I would like a single IEnumerable(Of T) which will iterate through all SubItems of all MasterItems in MasterList
我想认为有一个LINQ设施要做到这一点,或者一个扩展方法,我俯瞰。我需要一个在VB9(2008年)的作品,因此不使用屈服机制。
I would like to think that there is a Linq facility to do this, or an extension method I am overlooking. I need a mechanism that works in VB9 (2008) and hence does not use Yield.
您是否正在寻找的SelectMany()?
Are you looking for SelectMany()?
MasterList.SelectMany(master => master.SubItems)
对不起,C#,不知道VB。
Sorry for C#, don't know VB.