Я хочу десериализовать JSON с массивом, используя десериализацию RestSharp.
public class details
{
public string id { get; set; }
public string tran_id { get; set; }
public string tran_type { get; set; }
public string tran_status { get; set; }
public string expiry_date_time { get; set; }
public string number { get; set; }
}
Мой JSON, как показано ниже:
{
"details": [
{
"id": "ebca66079b44",
"tran_id": "c9b1bce025f5",
"tran_type": "A",
"tran_status": "B",
"expiry_date_time": "2018-11-26T06:33:04+00:00",
"number": "12345678ABC"
},
{
"id": "ebca66079b44",7c2445c8-a5ba-4ad2-a38e-3ea682c60edf",
"tran_id": "3ea682c60edf",
"tran_type": "A",
"tran_status": "B",
"expiry_date_time": "2018-11-26T06:26:28+00:00",
"number": "22345678ABC"
},
{
"id": "ebca66079b44",
"tran_id": "e40c45817985",
"tran_type": "A",
"tran_status": "B",
"expiry_date_time": "2018-11-26T06:26:06+00:00",
"number": "32345678ABC"
}
]
}
И мой код:
IRestResponse response = client.Execute(request);
//Deserialize Json
return new JsonDeserializer().Deserialize<List<details>>(response);
Я могу получить «детали», но не списоквнутри объекта.