Reputation: 13
How to convert an object into List<>. this is my object.I want to read productid,is selected from this object
product {
"data": [
{
"productID": 1,
"isSelected": true
},
{
"productID": 10,
"isSelected": true
},
{
"productID": 27,
"isSelected": false
},
{
"productID": 28,
"isSelected": false
},
{
"productID": 29,
"isSelected": false
},
{
"productID": 35,
"isSelected": false
}
]
}
object {Newtonsoft.Json.Linq.JObject}
Upvotes: 0
Views: 149
Reputation: 1414
Assuming you are using C#. A good practice is to use [JSON.NET][1]
There are lots of examples shown on the Documentation section.
You can construct your object using the library and perform the needful operation
Upvotes: 2