Cannot deserialize the current JSON object into type 'System.Collections.Generic.List

前端 未结 3 1165
深忆病人
深忆病人 2021-01-25 23:44

I am trying to read my JSON result.

Here is my JsonResult

public class JsonResult
    {
    public string ResponseStatus;
    public string Status;
    p         


        
3条回答
  •  天涯浪人
    2021-01-25 23:58

    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!

提交回复
热议问题