I have checked this Deserializing a JSON dictionary and Deserialize json to list of KeyValue pairs
They don't quite answer my question. My JSON data is in the form
[{"Question":{"Id":1,"SecretQuestion":"Which city were you born"},"Id":1,"SecretAnswer":"ABCD"}]
I have a class
<JsonProperty(PropertyName:="secretQuestion")>
Private _secretQuestion As String
<JsonProperty(PropertyName:="secretAnswer")>
Private _secretAnswer As String
<JsonProperty(PropertyName:="hintsId")>
Private _hintsId As Integer
<JsonIgnore>
Public Property SecretQuestion() As String
Get
Return Me._secretQuestion
End Get
Set
Me._secretQuestion = Value
End Set
End Property
<JsonIgnore>
Public Property SecretAnswer() As String
Get
Return Me._secretAnswer
End Get
Set
Me._secretAnswer = Value
End Set
End Property
<JsonIgnore>
Public Property HintsId() As String
Get
Return Me._hintsId
End Get
Set
Me._hintsId = Value
End Set
End Property
To store the value of secret question and answer and the first id. I have tried some deserialization methods proposed on SO but none seems to work well