I am making a call to a third party API, and the json string I get back looks like this:
{
"data":[
{"id":197567,"name":"101","url":"http://www.foobar1.com"},
{"id":197568,"name":"102","url":"http://www.foobar2.com"},
.....
{"id":197569,"name":"120","url":"http://www.foobar20.com"}
],
"offset":0,
"pageSize":2,
"count":20
}
FoorBarURIs
private class FoorBarURLs
{
public int id { get; set; }
public string name { get; set; }
public string url { get; set; }
}
offset
pagesize
count
data
data
List<FoorBarURLs> myList = JsonConvert.DeserializeObject<List<FoorBarURLs>>(???)
Use a temporary JObject
var obj = JObject.Parse(json)["data"].ToObject<List<FoorBarURLs>>();