I have a json string that i'm trying to parse with JSON.net, i want to loop and use the names in the komponent array. This is my json string:
{"Name": "Service","jsonTEMPLATE": "{"komponent": [{"name": "aa"}, {"name": "bb"}]}"}
This is my code using JSON.net
JObject o = JObject.Parse(serviceData);
JToken j = (JToken)o.SelectToken("jsonTEMPLATE");
JArray a = (JArray)j.SelectToken("komponent");
foreach (JObject obj in a)
{
//Do something
}
i get null from (JArray)j.SelectToken("komponent");
What am i doing wrong?