'{' expected
To declare an instance of a named or anonymous type by using an object initializer, you must enclose the list of fields or properties and their initial values in braces ({ and }).
VB
Dim client As New Customer() With {.Name = "Microsoft", .City = "Seattle"}
Dim emp = New Employee() With {.Name = "Rob Young", .ID = 55555}
Dim anon = New With {.ID = 123456}
Error ID: BC30987
- Include an initialization list after
With
, enclosed in braces.
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET feedback
.NET is an open source project. Select a link to provide feedback: