格式化日期,首字母大写
1.添加
Install-Package Microsoft.AspNetCore.Mvc.NewtonsoftJson -Version 3.0.0-preview8.19405.7
2.格式化
services.AddRazorPages().AddNewtonsoftJson(options => {
options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss";
options.SerializerSettings.ContractResolver = new DefaultContractResolver();
});