I want to deserialize the below Json object,
var jsonObject = {
"name": "sections",
"record": [
{
"id": 1,
"name": "sections",
"tables":
{
"sections":
{
"id": "1",
"type": "2"
}
}
}
]
}
In C#
var result = JsonConvert.DeserializeObject<Response>(jsonObject);
Added below classes for deserialize
public class Response
{
[JsonProperty("name")]
public string Name;
[JsonProperty("record")]
public List<Records> Record;
}
public class Records
{
[JsonProperty("id")]
public int Id;
[JsonProperty("name")]
public string Name;
[JsonProperty("tables")]
public List<Table> Tables;
}
public class Table
{
[JsonProperty("sections")]
public List<Sections> Sections;
}
public class Sections
{
[JsonProperty("id")]
public string id;
[JsonProperty("type")]
public string Type;
}
I want to get the "Type" from the json, but it is not deserialized properly. Can anyone suggest how to get the Type from the Json Object.