步骤一:最好是自己创建一个和json包中字段一样的实体类接收数据(推荐),也可以用原有的实体类
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace cmxapi.Models
{
public class FinancialCreditCarApplyModel
{
public int BrandID { get; set; }
public int SeriesID { get; set; }
public int CarsType { get; set; }
public int EntId { get; set; }
public int CrtUser { get; set; }
public int Status { get; set; }
public int LineNum { get; set; }
public DateTime CrtDate { get; set; }
}
}
步骤二:引用命名空间 using Newtonsoft.Json; 通过 nuget下载
步骤三:使用 该方法 JsonConvert.DeserializeObject(obj) 解析json包数据 里面可以是任何类型的