How to disable camel case in core?

In dotnet core default case for serializing output to json is camelCase. We can change the default case to Pascal by setting the new DefaultContractResolver


  1. Go to Startup.cs class file.
  2. Find Startup.ConfigureServices method and add the below line of code.
public void ConfigureServices(IServiceCollection services)
    // Add Services
        .AddJsonOptions(options => options.SerializerSettings.ContractResolver = new DefaultContractResolver());