How to turn off or handle camelCasing in JSON response ASP.NET Core?

后端 未结 7 1704
攒了一身酷
攒了一身酷 2020-11-29 07:55

I\'m running through a WintellectNOW course on ASP.NET Core/Web API/Angular 2. I have the API portion implemented, but for whatever reason, the JSON that is being returned h

7条回答
  •  执笔经年
    2020-11-29 08:26

    Another solution in Asp.Net.Core 2.2 as following:

    services.AddMvc()
    .AddJsonOptions(jsonOptions => jsonOptions.UseMemberCasing())
    .SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
    

提交回复
热议问题