I’m trying to make a windows phone application that reads a json file from a website. This json file has a repeating group and I can’t seem to get the program to read all the groups.
This is an example of the json output:
{
"program":{
"title":"Carl Schmitz",
"image_url":"http:\/\/q-music.be\/sites\/2009.q-music.be\/files\/NOA.jpg"
},
"noa":[
{
"title":"Behind Blue Eyes",
"artist":"LIMP BIZKIT",
"itunes_link":"http:\/\/clk.tradedoubler.com\/click?p=24379&a=1256924?url=http:\/\/itunes.apple.com\/be\/album\/behind-blue-eyes\/id14915153?i=14915155&uo=4&partnerId=2003"
},
{
"title":"Alone Again",
"artist":"ALYSSA REID",
"itunes_link":"http:\/\/clk.tradedoubler.com\/click?p=24379&a=1256924?url=http:\/\/itunes.apple.com\/be\/album\/alone-again-original-mix\/id496520410?i=496520415&uo=4&partnerId=2003"
}
]
}
Can someone explain me how to read this json?
Your class structure should look something like this. I used the awesome json2csharp to generate it:
Then you should be able to deserialize directly into the RootObject. You didn’t mention which serializer you were using, so the actual deserialization isn’t shown here (yet).