VB.NET 2010是否支持匿名对象的数组?

时间:2010-09-26 19:19:39

标签: vb.net anonymous-types

在C#中,可以使用new []创建一个匿名对象数组。这在早期版本的VB.NET中不受支持,但a comment by Chris Dwyer in another StackOverflow post向我建议它可能在VB.NET 2010中得到支持。虽然我无法证实这一点。

VB.NET 2010是否支持匿名对象数组?

1 个答案:

答案 0 :(得分:22)

是的。你可以这样写一个:

Dim values = {New With {.First = "Matt"}, New With {.First = "Mallory"}}

更新:我删除了Ahmad Mageed指出的值之后的not needed()