Imports System.Collections
Imports System.Collections.Generic
Imports System.Globalization
Imports System.Reflection
Imports System.ComponentModel.DataAnnotations
Imports Microsoft.VisualBasic
Imports Newtonsoft.Json.Linq
Imports Newtonsoft.Json.Converters
Imports Newtonsoft.Json.Serialization
Public Property Result As List(Of Dictionary(Of String, List(Of Result)))
<JsonProperty("message")>
Public Property Message As String
Public Property Uri As String
Public Property Status As Integer
<JsonProperty("CreatedTime")>
Public Property CreatedTime As String
<JsonProperty("ZP_Leave_File_Upload")>
Public Property ZPLeaveFileUpload As String
<JsonProperty("Employee_ID")>
Public Property EmployeeID As String
<JsonProperty("AddedTime")>
Public Property AddedTime As String
<JsonProperty("Leavetype.ID")>
Public Property LeavetypeID As String
Public Property From As String
Public Property Unit As String
<JsonProperty("ModifiedBy")>
Public Property ModifiedBy As String
<JsonProperty("ApprovalStatus")>
Public Property ApprovalStatus As String
<JsonProperty("Daystaken")>
Public Property Daystaken As String
<JsonProperty("Reasonforleave")>
Public Property Reasonforleave As String
<JsonProperty("ModifiedBy.ID")>
Public Property ModifiedByID As String
<JsonProperty("TeamEmailID")>
Public Property TeamEmailID As String
<JsonProperty("Leavetype")>
Public Property Leavetype As String
<JsonProperty("ModifiedTime")>
Public Property ModifiedTime As String
<JsonProperty("ApprovalTime")>
Public Property ApprovalTime As String
<JsonProperty("Zoho_ID")>
Public Property ZohoID As Long
<JsonProperty("AddedBy.ID")>
Public Property AddedByID As String
Public Property [To] As String
<JsonProperty("AddedBy")>
Public Property AddedBy As String
<JsonProperty("Employee_ID.ID")>
Public Property EmployeeIDID As String
<JsonProperty("DateOfRequest")>
Public Property DateOfRequest As String
<JsonProperty("ZP_Leave_File_Upload_downloadUrl")>
Public Property ZPLeaveFileUploadDownloadUrl As String
Dim json as String = GetJson()
Dim root as RootObject = JsonConvert.DeserializeObject(Of RootObject)(json)
Dim newJson as String = JsonConvert.SerializeObject(root, Newtonsoft.Json.Formatting.Indented)
Console.WriteLine("Re-serialized {0}", root)
Console.WriteLine(newJson)
Function GetJson() as String
Dim Jstring As String = <![CDATA[{
"CreatedTime": "1574925427929",
"ZP_Leave_File_Upload": "",
"AddedTime": "28-Nov-2019 11:17:07",
"Leavetype.ID": "507258000000169001",
"ApprovalStatus": "Approved",
"ModifiedBy.ID": "507258000000145005",
"Leavetype": "Annual Leave",
"ModifiedTime": "1574925427930",
"ApprovalTime": "28-Nov-2019 11:17 AM",
"Zoho_ID": 507258000002665141,
"AddedBy.ID": "507258000000145005",
"Employee_ID.ID": "507258000000148879",
"DateOfRequest": "28-Nov-2019",
"ZP_Leave_File_Upload_downloadUrl": ""
"CreatedTime": "1574922096199",
"message": "Data fetched successfully",
"uri": "/api/forms/P_ApplyLeave/getRecords",
Console.WriteLine("Environment version: " & Environment.Version.ToString())
Console.WriteLine("Json.NET version: " & GetType(JsonSerializer).Assembly.FullName)
Console.WriteLine("Unhandled exception: ")