I figure I should use ‘Aggregate’ but apparently I am getting it wrong
First I get a list of my Entity objects
Dim employers As List(Of myEntity) = (New XXXX()).getZZZ(userName, userType)
Then I figured this would be a way to put all the names in a string
Dim names as String = employers.Aggregate(Function(current, [next]) current.Name & " " & [next].Name)
but I get the error: “Cannot convert type ‘lambda expression’ to parameter type ‘System.Func(Of myEntity, myEntity, myEntity……”
any clues?
Try this instead:
Dim names = String.Join(" ", employers.Select(Function(employer) employer.Name))