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

后端 未结 8 2109
逝去的感伤
逝去的感伤 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:51

    For some one who is using ASP.net WEB API ( rather than ASP.NET Core).

    Add this line in your WebApiConfig.

    //Comment this jsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
    
    jsonFormatter.SerializerSettings.ContractResolver = new DefaultContractResolver();
    

    Adding this as an answer here because this comes up first in google search for web api as well.

提交回复
热议问题