我用下面的JSON字符串如何反序列化JSON字符串在C#中的点到对象列表
{
"transactions":
[
{
"paymentcharge":"0.0",
"amount":352,
"id":13418,
"shippingcharge":35,
"shippingtype":2,
"status":2,
"paymenttype":1,
"date":"2012-10-06 16:15:28.0"
},
{
"paymentcharge":"0.0",
"amount":42455,
"id":16305,
"shippingcharge":0,
"shippingtype":2,
"status":2,
"paymenttype":2,
"date":"2012-11-30 09:29:29.0"
},
{
"paymentcharge":"1.0",
"amount":42456,
"id":16305,
"shippingcharge":0,
"shippingtype":2,
"status":2,
"paymenttype":2,
"date":"2012-11-30 09:29:29.0"
}
],
"count":3
}
我有一个类结构解析如下,感觉JSON数据
class clsSalesTran
{
public double paymentcharge { get; set; }
public double amount { get; set; }
public long id { get; set; }
public int shippingcharge { get; set; }
public int shippingtype { get; set; }
public int status { get; set; }
public int paymenttype { get; set; }
public DateTime date { get; set; }
}
工作
如何反序列化上面的JSON字符串到列表中?
我正在使用Newtonsoft.Json进行反序列化。
如何装饰类成员以匹配JSON对象? 对于防爆:JSON对象包含{1024720: “somePic.jpg”} 我有一个类 公共类别图像 { 公共字符串HdImage; } – 2014-02-25 11:14:28