K
kurt sune
I need help with translating this:
This works i C#
List<Customer> customers = new List<Customer> {
new Customer { Fullname = "Pelle" },
new Customer { Fullname = "Oskar" },
new Customer { Fullname = "Hasse" },
new Customer { Fullname = "Zrjan" },
new Customer { Fullname = "Harald" },
new Customer { Fullname = "Adam" }};
This does not work in VB:
Dim customers As New List(Of Customer) _
(New Customer With {.Fullname = "Pelle"}, _
New Customer With {.Fullname = "Oskar"}, _
New Customer With {.Fullname = "Hasse"}, _
New Customer With {.Fullname = "Zrjan"}, _
New Customer With {.Fullname = "Harald"}, _
New Customer With {.Fullname = "Adam"})
Can someone please tell me why?
/k
This works i C#
List<Customer> customers = new List<Customer> {
new Customer { Fullname = "Pelle" },
new Customer { Fullname = "Oskar" },
new Customer { Fullname = "Hasse" },
new Customer { Fullname = "Zrjan" },
new Customer { Fullname = "Harald" },
new Customer { Fullname = "Adam" }};
This does not work in VB:
Dim customers As New List(Of Customer) _
(New Customer With {.Fullname = "Pelle"}, _
New Customer With {.Fullname = "Oskar"}, _
New Customer With {.Fullname = "Hasse"}, _
New Customer With {.Fullname = "Zrjan"}, _
New Customer With {.Fullname = "Harald"}, _
New Customer With {.Fullname = "Adam"})
Can someone please tell me why?
/k