I'd like to count the number of properties within an object. I have found several solutions but none really counts the child\nested propertie.
For instance, I have the following JSON object.
{
"id": "259a36d2-3852-425f-a70c-3f9477753210",
"name": "foo",
"type": "na",
"text": "ABC.pdf",
"left": 333,
"top": 130,
"w": 134,
"h": 34,
"customData": {
"A": "fa6css4ec8-8ffb-55bca4dde06a",
"name": "SDF.pdf",
"IsExists": false,
"PNumber": 1,
}
}
When trying the following I'm getting the result of 9, while I'm expecting 12 (which is the count of the entire properties).
JObject sourceJObject = JsonConvert.DeserializeObject<JObject>(json);
var res= sourceJObject.Count;
I'll be happy for assistant.