I am trying to call an API and getting the results back in the form of JSON. I need to parse the data received and collect the specific data "key" under mapping in below mentioned JSON data from the array. I also want to get the total count of key under the mapping, so that I can recurse the array and retrieve the key.
JSON data as below,
{
"$type": "Type1",
"mapping": [
{
"value": "Value1",
"key": "Key1"
},
{
"value": "Value2",
"key": "Key2"
}
]
}
I am stuck in the code until below mentioned. Was not sure how to proceed further. Kindly suggest how can I get the value
using (var webResponse = (HttpWebResponse)webrequest.GetResponse())
{
using (var sr = new StreamReader(webResponse.GetResponseStream()))
{
text = sr.ReadToEnd();
dynamic jsonObject = JsonConvert.DeserializeObject(text);
//Need suggestion how can I retrieve the specific
}
}