In vb.net How to convert a list of objects within another List of Objects to csv string. I tried below didn't work
String.Join(",", Person.Cars.Select(Function(d) d.Colors.Select(Function(o) o.colorid.ToString)))
Output should be colorid in string csv eg: "101,102,103"
If i try for Car ids that works as expected
String.Join(",", Person.Cars.Select(Function(d) d.carid.ToString))
output is "2001,2002,2003"
Here's how data is constructed
Dim objPerson As New Person
With objPerson
.Cars = new Cars (1) {}
.Cars(0) = new Cars
.Cars(1) = new Cars
With Cars(0)
.CarId = "2001"
.Colors = new Colors(1){}
.Colors(0) = new Colors
.Colors(1) = new Colors
With .Colors(0)
.Colorid = "101"
End With
With .Colors(1)
.Colorid = "102"
End With
End With
With Cars(1)
.CarId = "2002"
.Colors = new Colors(1){}
.Colors(0) = new Colors
.Colors(1) = new Colors
With .Colors(0)
.Colorid = "103"
End With
With .Colors(1)
.Colorid = "104"
End With
End With
End With
End With