Disable json serialization naming policy in asp.net core

In Startup.cs add yellow highlighted code:


public void ConfigureServices(IServiceCollection services)

        {

            services.AddAuthentication(IISDefaults.AuthenticationScheme);

            services.AddCors();

            services.AddControllers().AddJsonOptions(jsonOptions =>

            {

                jsonOptions.JsonSerializerOptions.PropertyNamingPolicy = null;

            }); 

Comments

Popular posts from this blog

Hosting api locally on IIS for development