https://github.com/BobinYang/NetCoreWebAPI_Demo/
视频地址:https://www.bilibili.com/video/BV11E411n74a
使用net core3.1 使用JSON
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddControllers() .AddNewtonsoftJson(options => { // Use the default property (不改变元数据的大小写) casing options.SerializerSettings.ContractResolver = new DefaultContractResolver(); }); }