How to disable camel case in asp.net 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

Steps

  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
    services.AddMvc()
        .AddJsonOptions(options => options.SerializerSettings.ContractResolver = new DefaultContractResolver());
}