Given....
Public MasterList as IEnumerable(Of MasterItem)
Public Class MasterItem(Of T)
Public SubItems as IEnumerable(Of T)
End Class
I
Just to provide true VB.NET answers:
' Identical to Per Erik Stendahl's and Oliver Hanappi's C# answers
Dim children1 = MasterList.SelectMany(Function(master) master.SubItems)
' Using VB.NET query syntax
Dim children2 = From master In MasterList, child in master.SubItems Select child
' Using Aggregate, as the question title referred to
Dim children3 = Aggregate master In MasterList Into SelectMany(master.SubItems)
These all compile down to the same IL, except children2
requires the equivalent of Function(master, child) child
.