I am using a Javascript library which expects data to be in a certain json format as show below. I will use .NET to get the data and feed it to the library using json deserialization. However I am not sure how C# classes are serialized to json. Will the built-in .NET json serializer support this json structure or do I have to invest in a more advanced library like json.net? I never used json.net. My approach is to do several trial and error approaches creating different C# classes and looking at the output json until the json structure matches the format below. This seems inefficient and time consuming and I wanted to know if there's a better approach.
Note: Each second level node can have 1 or more children. For example: the ones with playcount 276, 271.
{
"children": [
{
"children": [
{
"children": [],
"data": {
"playcount": "276",
"$color": "#8E7032",
"image": "http://userserve-ak.last.fm/serve/300x300/11403219.jpg",
"$area": 276
},
"id": "album-Thirteenth Step",
"name": "Thirteenth Step"
},
{
"children": [],
"data": {
"playcount": "271",
"$color": "#906E32",
"image": "http://userserve-ak.last.fm/serve/300x300/11393921.jpg",
"$area": 271
},
"id": "album-Mer De Noms",
"name": "Mer De Noms"
}
],
"data": {
"playcount": 547,
"$area": 547
},
"id": "artist_A Perfect Circle",
"name": "A Perfect Circle"
},
.....