I am Writing a Code using C# that will Parse JSON Code and create it as objects.
I have this JSON Example
{
"firstName": "John",
"lastName" : "Smith",
"age" : 25,
"address" :
{
"streetAddress": "21 2nd Street",
"city" : "New York",
"state" : "NY",
"postalCode" : "10021"
},
"phoneNumber":
[
{
"type" : "home",
"number": "212 555-1234"
},
{
"type" : "fax",
"number": "646 555-4567"
}
]
}
as you can see there is multible numbers, some Person have 1 telephone numbers, some others has 4 or 5.
I know i should do a While Loop, but can i get how many Phones are inside the Phone number to use it a counter to add these phones to PhoneNumber Object that i created?
phoneNumberis an Array of{type" : "..","number": ".." }