I have the following json
{"audit_entry": {
"where_uri": "test.com/service/apps/171f0841-825b-4964-8f8c-0869650f14a6",
"why_uri": "test.com/service/reference/reasons_for_change/43545kjhjhkj0869650f14a6",
"who_uri": "test.com/service/users/4977dae1-a307-425f-980c-53413fef1b0f",
"when_audited": "2018-11-13T20:20:39+00:00",
"what_uri": "test.com/service/subjects/1bc67a71-8549-4ab8-9dd9-e44238198860",
"what_changed": [
{
"attribute_name": "birth_year",
"attribute_value": "1969",
"attribute_change": null
},
{
"attribute_name": "subject_reference",
"attribute_value": "dsdsfg",
"attribute_change": null
}
]
}
I want to be able to change the value of "attribute_value" in the second child of what_changed. i.e. index [1]. I have tried the following code:
JObject jObj = JObject.Parse(jsonText);
jObj["audit_entry"]["what_changed"]["attribute_name"[1]];
But I know I have an issue with syntax.
Any ideas would be much appreciated. Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…