I need to read the value of testCase.name for id 100000 from following JSON response string.
response = {
"count": 2,
"value": [
{
"id": 100000,
"project": {
"id": "aaaa-bbbb-cccc-dddd",
"name": "MyTestProject",
"url": "https://dev.azure.com/MyOrg/_apis/projects/MyTestProject"
},
"testCase": { "name": "GetProjectTeamDetails" }
},
{
"id": 100001,
"project": {
"id": "aaaa-bbbb-cccc-dddd",
"name": "MyTestProject",
"url": "https://dev.azure.com/MyOrg/_apis/projects/MyTestProject"
},
"testCase": { "name": "QueueBuild" }
}
]
}
I've tried the following codes but could not achieve: Try1:
JObject o = JObject.Parse(response)
string testCaseName= (string)o["values"][0];
Try2:
JObject jObject = JObject.Parse(response);
string displayName = (string)jObject.SelectToken("testCase.name");