I am receiving the JSON formatted string from a web service over the Internet.
It is roughly formatted like so:
{ "version" : 2,
"query" : "Companies, CA",
"begin" : 1,
"end" : 3,
"totalResults" : 718,
"pageNumber" : 0,
"results" : [
{ "company" : "ABC Company Inc.", "city" : "Sacramento", "state" : "CA" } ,
{ "company" : "XYZ Company Inc.", "city" : "San Francisco", "state" : "CA" } ,
{ "company" : "KLM Company Inc.", "city" : "Los Angeles", "state" : "CA" }
]
}
I need to get the array of companies out of this results element and add these to a list of companies, something like List<Company>, where Company is a simple class with Name, City, and State properties.
Finally, I am not able to use any third party JSON parsers. What is the best way to get this done?
Thanks,