[英]How to convert object into list
How to convert an object into List<>. 如何将对象转换为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}
Assuming you are using C#. 假设您正在使用C#。 A good practice is to use [JSON.NET][1] 一个好的做法是使用[JSON.NET] [1]
http://json.codeplex.com/ 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 您可以使用库构造对象并执行必要的操作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.