I need to get the first child of JObject
.
This is how I temporarily solved it with foreach loop breaking after first iteration.
foreach (KeyValuePair<string, JToken> item in (JObject)json["stats"])
{
// doing something with item
break;
}
I wonder if there is shorter solution, like json["stats"][0]
(however it doesn't work this way).
JObject item = (obj["stats"].First as JProperty).Value as JObject
You can update your answer if someone else needs it. – Aeolus