我需要使用 RestSharp 阅读以下代码。我的问题是如何使数组具有正确的结构。我需要如何设置将包含该对象的类以使其正常工作?
我想反序列化 AcUserInfo 类型列表中的对象“0”和“1”。
非常感谢。安德烈亚
{
"0":{
"id":"2",
"subscriberid":"2",
"cdate":"2012-09-28 16:49:06",
"sdate":"2012-09-28 16:49:06",
"first_name":"Al",
"last_name":"",
"email":"test@verizon.net"
},
"1":{
"id":"29",
"subscriberid":"29",
"cdate":"2012-10-02 15:08:29",
"sdate":"2012-10-02 15:08:29",
"first_name":"Mark",
"last_name":"",
"email":"test2@verizon.net"
},
"result_code":1,
"result_message":"Success: Something is returned",
"result_output":"json"
}
这是我创建的课程:
public class SubscriberList {
public int result_code { get; set; }
public string result_message { get; set; }
public string result_output { get; set; }
public List<AcUserInfo> row { get; set; }
SubscriberList(){
row = new List<AcUserInfo>();
}
}