I have this JSON format:
string jsonFormat = @"{
""Applications"": {
""data"": {
""Application named one"": [
{
""index"" : ""1"",
""name"" : ""One"",
""active"" : ""1"",
""excluded"" : ""false""
}
],
""Application named two"": [
{
""index"" : ""2"",
""forum"" : ""yes"",
}
]
}
}
}";
How exactly I can acces data childrens ? I need to retreive Application named one and Application named two – for each also the attributes with their values – the attributes are different from Application to Application.
Untill now I have:
JObject resultt= JObject.Parse(jsonFormat);
// get JSON result objects into a list
IList<JToken> results = resultt["Applications"]["data"].Children().ToList();
I looked over JSON.net documentation and could not find a solution for this…
Any help will be very usefull. Thank you.
I think you are looking for something like this:
Basically the idea is to use the
Valuemethod with the type you are expecting to retrieve a specific json element (JObject, JArray, …) or parse a .NET value (int, string, bool, …).