I working with a JSON that has this form:
{
"success": true,
"message": "OK!",
"result": [
{
"Id": 1,
"description": "Creacion",
"name": "name1"
},
{
"Id": 1,
"description": "Creacion",
"name": "name2"
}
]
}
I want to get the result
array data. I've trying with this:
List<object> list = new List<object>();
public async Task<bool> GetList()
{
JObject json = new JObject();
HttpClient http = new HttpClient();
string urlComplete = "https://..."; // url where the data is obtained
var response = await http.GetAsync(urlComplete);
var result = response.Content.ReadAsStringAsync().Result;
json = JObject.Parse(result);
ContractStateList = JsonConvert.DeserializeObject<List<object>>(json.ToString());
return true;
}
But it throws an error that says Cannot deserialize the current JSON object
...
Any help is appreciated.