I have the following code :
dynamic stuff = JsonConvert.DeserializeObject(\"{ \'Name\': \'Jon Smith\', \'Address\': [\'A\', \'B\', \'C\'], \'Age\': 42 }\");
var
This is a simple solution which will help you also in a lot of Projects.
{
"Name": "Jon Smith",
"Address":
[
"A",
"B",
"C"
],
"Age": "42"
}
You have to create a class for your items.
public class JSONClass
{
public string Name { get; set; }
public string[] Address { get; set; }
public string Age { get; set; }
}
Then you have to make a List that will keep your items:
public class ItemsList
{
public List JsonItems { get; set;}
}
And then you can simple retrieve your Items.
ItemsList itemsList = new ItemsList();
itemsList.JsonItems = JsonConvert.DeserializeObject("yourAPIResponse").JsonItems ;