VbNet · Console
Imports System
Imports System.Collections.Generic
Imports Newtonsoft.Json
Public Module Module1
Public Sub Main()
Dim model as Model = New Model With
{
.name = "Tiger Nixon",
.position = "System Architect",
.salary = "$320,800",
.start_date = "2011/04/25",
.office = "Edinburgh",
.extn = "5421"
}
Dim anon = New With {.data = New List(Of Model) From {model}}
Dim json As String = JsonConvert.SerializeObject(anon, Formatting.Indented)
Console.WriteLine(json)
End Sub
Public Class Model
Public Property name As String
Public Property position As String
Public Property salary As String
Public Property start_date As String
Public Property office As String
Public Property extn As String
End Class
End Module