/// <summary>
/// This method gets called by the runtime. Use this method to add services to the container.
/// </summary>
/// <param name="services"></param>
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc().AddJsonOptions(options => { options.SerializerSettings.ContractResolver = new DefaultContractResolver(); });
问题来源于我写了一个接口,接口的返回类型是JsonResult,但是对接之后反应返回结果的首字母全小写了,后来查了写资料返现.net core 对json 的处理默认使用驼峰式,需要在ConfigureServices 方法中全局这只先不适用驼峰式处理 /// &lt;summary&gt; /// This method gets called by the runti...