Online: 23568
Below is the code snippet of valid JSON data.
This sample JSON data is converted from a single object whose property is AutoId, FirstName, LastName, Age, Active.
{"AutoId":16,"FirstName":"Sheo","LastName":"Narayan","Age":25,"Active":true}
Below code snippet is the collection items. Where item property is CategoryId, CategoryName.
[
{"CategoryId":1,"CategoryName":".NET Technologies"},
{"CategoryId":2,"CategoryName":"Java Technologies"},
{"CategoryId":4,"CategoryName":"Open Stack"}
]
Below JSON data is for the collection of SubCategory object whose CategoryId property is foreign key of Category object (noted here as Categories that is nothing but collection of Category).
[
{"Categories":
{"CategoryId":1,"CategoryName":".NET Technologies"},
"SubCategoryId":1,"SubCategoryName":"ASP.NET","CategoryId":1
},
{"Categories":
{"CategoryId":2,"CategoryName":"Java Technologies"},
"SubCategoryId":2,"SubCategoryName":"Sprint","CategoryId":2
},
{"Categories":{"CategoryId":1,"CategoryName":".NET Technologies"},
"SubCategoryId":4,"SubCategoryName":"ASP.NET MVC","CategoryId":1
},
{"Categories":{"CategoryId":4,"CategoryName":"Open Stack"},
"SubCategoryId":5,"SubCategoryName":"Mongo DB","CategoryId":4
}
]
XML stuffs
Views: 6202 | Post Order: 8