JSON properties now lower case on swap from ASP .Net Core 1.0.0-rc2-final to 1.0.0

后端 未结 8 2108
逝去的感伤
逝去的感伤 2020-12-08 12:54

I\'ve just swapped our project from ASP .Net Core 1.0.0-rc2-final to 1.0.0. Our website and client have stopped working because of the capitalization of JSON properties. For

8条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-08 13:45

    MVC now serializes JSON with camel case names by default

    Use this code to avoid camel case names by default

      services.AddMvc()
            .AddJsonOptions(options => options.SerializerSettings.ContractResolver = new DefaultContractResolver());
    

    Source: https://github.com/aspnet/Announcements/issues/194

提交回复
热议问题