I am trying to convert a JSON string into a list of objects but am getting the error
Cannot deserialize the current JSON object into type List because the type requires a JSON array to deserialize correctly.
I retrieve the json and it looks like this
{
"Code":0,
"Message":"OK",
"Data":
{
"Houses":
[
{
"Id":1,
"Name":"House 1",
"Area":"22.00",
"ShortName":"H1",
"FarmName":"Farm 1"
},
{
"Id":2,
"Name":"Farmi1 - House 1",
"Area":"1000.00",
"ShortName":"H1",
"FarmName":"Farm 1"
}
]
}
}
I then say
List<House> Houses = JsonConvert.DeserializeObject<List<House>>(json);