I'm using JSON.NET to deserialize JSON responses from HTTP queries, but I have a problem on deserialization.
The source JSON is like that:
[
{
"type": "rpc",
"tid": 18,
"action": "TaskSystem",
"method": "createTask",
"result": {
"0": {
"success": true,
"successes": [
[
"Task successfuly created with S/N #22920"
]
]
},
"1": {
"success": true,
"successes": [
[
"Task successfuly created with S/N #22921"
],
"Task #22921 marked as urgent"
]
},
"records": [
{
"id": 22920
},
{
"id": 22921
}
],
"success": true
}
}
]
I've been using these classes for deserialization:
Private Sub Deserialize()
Dim Jobj = Newtonsoft.Json.JsonConvert.DeserializeObject(Of Response())(Jstring)
End Sub
Public Class Record
Public Property id As Integer
End Class
Public Class Result
Public Property records As Record()
Public Property success As Boolean
End Class
Public Class Response
Public Property type As String
Public Property tid As Integer
Public Property action As String
Public Property method As String
Public Property result As Result
End Class
But then I am losing the success/failure messages returned by the query
How should I write the class Result in order to colect the properties records As Record(), succes As Boolean and also those objects named "0", "1" and so on...?
Thank you very much for any help.