EF Power Tools defaulting to pascalcase

118 Views Asked by At

We recently adopted EF Power Tools reverse engineering to create our entities in our .Net Core 3 Web Apis. This has had the unintended consequence of returning data in pascalcase instead of the default camelcase. I have tried in the startup.cs:

services.AddMvc.AddJsonOptions(options => options.JsonSerializerOptions.PropertyNamingPolicy =
 JsonNamingPolicy.CamelCase)

and

services.AddNewtonsoftJson(options => options.UseCamelCasing(true))
1

There are 1 best solutions below

0
On

You can try to add the following in your Configure section:

JsonConvert.DefaultSettings = () => new JsonSerializerSettings
{
    ContractResolver = new CamelCasePropertyNamesContractResolver()
};