How To Read this Data
"Data": [
{
"Candidate Details": {
"Salutation": "au.linkedin.com/in/324234",
"First Name": "test (Demo)",
"Last Name": "1MORN,2AFTE",
"Nationality": "",
"Australian Residency / Visa Status": "1PR",
"Email": "testn@324234.com",
"Mobile No.": "2345234",
"Home Telephone": "234234",
"Work Telephone": "234234"
},
"[Current Residential Address]": {
"City / Town": "234243",
"Province / State": "23423",
"ZIP / Post Code": "234234",
"Country": "0_AU"
},
"[Education & Experience]": {
"Seniority": "0000-00-00 00:00:00",
"Speciality": "",
"Highest Education": "This is a test resume submitted with the following account details:\r\nnotes",
"Professional Qualification": "great exp",
"Educational Summary": "234234 in 234 First Aid",
"Work Experience": "2006-07-23 06:59:59",
"Australian Work Experience": "EMP",
"Work Experience Years": "Z_11+",
"Medical Registration": "GENER"
},
"[Availability & Preferences]": {
"Current Employment Status": "none",
"Can Relocate?": "",
"Available to Start": "01-Jan-1970",
"Salary Range": "",
"Location Preference": "1_profile1376113217.jpg",
"Positions Interested In?": "234234.doc"
},
"Additional Notes": [
"324(Demo)"
]
}
I can easily read Candidate Details but variable not access the [Current Residential Address]. Code is written below
var ss = o["Data"];
JArray s = ss as JArray;
var dt = s.ToArray();
foreach (var dss in dt)
{
var dtt = dss["Candidate Details"];
}
dtt Gets only first Record but not Select the rest on the parameters.
Your array only has one entry - which in turn has properties of "Candidate Details"
, "[Current Residential Address]"
etc. (It's not clear whether this really need to be an array at all.)
If you want to iterate over all the properties, you can use:
// Your array entry is an object
foreach (JObject candidate in s)
{
foreach (var pair in candidate)
{
Console.WriteLine("{0} = {1}", pair.Key, pair.Value);
}
}
or if you know the properties you want, you can fetch each of them by name, as you're already doing for candidate details.
See more on this question at Stackoverflow