I want to configure camlecase for JSON serialization in ASP.NET Core. I've found this solution. But it just works on MVC not WebApi.
So I've tested:
services.AddControllers().AddJsonOptions(options => {
options.JsonSerializerOptions.DictionaryKeyPolicy = JsonNamingPolicy.CamelCase;
options.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;
});
And it is not working in WebApi projects.
So the question is: How to configure Camel Case
in ASP.NET Core WebApi projects.