I have some JSON with Two objects and these each have 3 objects nested.
{
"FirstPerson": {
"number": "101",
"a10": "1001",
"a20": "1002"
},
"SecondPerson": {
"number": "102",
"a10": "2001",
"a20": "2001"
}
}
In c# asp.net mvc2 I’ve been able to get to “FirstPerson” or “SecondPerson” using a Hashtable but how do I get to “number” or “a10” when I know “FirstPerson”?
e.g. an objects inside an object.
Is a Hashtable the best use for this or should I be using something else?
Thanks in advance.
You could assign the JSON object to a dynamic variable and access the properties that way (only in C# 4.0 though)