I am trying to read my JSON result.
Here is my JsonResult
public class JsonResult
{
public string ResponseStatus;
public string Status;
p
If you want to send list of data List<Data>
then in JSON it should be in a form of array
Change the following JSON content
"Data": {"Status":"Pending",
"Date":"2017-02-23T17:22:26.2001954+05:30",
"Number":"9915933511",
"Amount":10.0,"Balance":137.714,
"TranId":"1126887","OPTId":"","RefId":""}
To
"Data": [{"Status":"Pending",
"Date":"2017-02-23T17:22:26.2001954+05:30",
"Number":"9915933511",
"Amount":10.0,"Balance":137.714,
"TranId":"1126887","OPTId":"","RefId":""}]
Data isn't a list, it's an object. Your models should look like this (Only JsonResult is modified):
public class Data
{
public string Status { get; set; }
public string Date { get; set; }
public string Number { get; set; }
public double Amount { get; set; }
public double Balance { get; set; }
public string TranId { get; set; }
public string OPTId { get; set; }
public string RefId { get; set; }
}
public class JsonResult
{
public string ResponseStatus { get; set; }
public string Status { get; set; }
public string Remarks { get; set; }
public string ErrorCode { get; set; }
public Data Data { get; set; }
}
Hope it helps!
In your Json string, Data is an object, not an array. So your JsonResult class should look like this:
public class JsonResult
{
public string ResponseStatus;
public string Status;
public string Remarks;
public string ErrorCode;
public Data Data;
}