I have tried various examples i found on stackoverflow as well as official documentation from www.newtonsoft.com. I am struggling to deserialize/parse this
{
"@odata.context": "http://localhost/WebApi/getDataCompanyData",
"value": [
{
"ID": "001",
"Name": "Sample Company"
}
]
}
and this with an array
{
"@odata.context": "http://localhost/WebApi/getDataCustomerData",
"value": [
{
"CustomerNumber": "A001",
"ShortName": "Customer A"
},
{
"CustomerNumber": "B001",
"ShortName": "Customer B"
}
]
}
I tried classes generated using http://json2csharp.com/ and i even tried something as simple as this
dynamic jsonstring = IO.File.ReadAllText("DATA\\cprofile.json");
dynamic companydata = Json.Linq.JObject.Parse(jsonstring);
dynamic CustomerNumber = companydata("CustomerNumber");
Interaction.MsgBox(CustomerNumber);
I have not worked with this JSON structure before. Anyone have advice in dealing with this kind of JSON structure?
Note: this is in winforms