Return json capitalized, time format, null values and other issues deal
In the Startup public void ConfigureServices (IServiceCollection services) add the following code function
services.AddControllers().AddNewtonsoftJson(options =>
{
// 忽略循环引用
options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
// 不使用驼峰
options.SerializerSettings.ContractResolver = new DefaultContractResolver();
// 设置时间格式
options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss";
// 如字段为null值,该字段不会返回到前端
// options.SerializerSettings.NullValueHandling = NullValueHandling.Ignore;
});