ramesh
ramesh

Reputation: 13

How to convert object into list

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

Answers (1)

codingpirate
codingpirate

Reputation: 1414

Assuming you are using C#. A good practice is to use [JSON.NET][1]

http://json.codeplex.com/

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

Related Questions