.NET Core WebApi中返回 json 数据首字母大小写问题
public void ConfigureServices(IServiceCollection services) { services.AddMvc().AddJsonOptions(opt => { opt.SerializerSettings.ContractResolver = new Newtonsoft.Json.Serialization.DefaultContractResolver();//json字符串大小写原样输出 }); }