Как добавить CamelCasePropertyNamesContractResolver в Startup.cs?

Вот мойConfigure метод из моегоStartup учебный класс.

public void Configure(IApplicationBuilder app)
{
    // Setup configuration sources
    var configuration = new Configuration();
    configuration.AddJsonFile("config.json");
    configuration.AddEnvironmentVariables();

    // Set up application services
    app.UseServices(services =>
    {
        // Add EF services to the services container
        services.AddEntityFramework()
           .AddSqlServer();

        // Configure DbContext
        services.SetupOptions<DbContextOptions>(options =>
        {
           options.UseSqlServer(configuration.Get("Data:DefaultConnection:ConnectionString"));
        });

        // Add Identity services to the services container
        services.AddIdentitySqlServer<ApplicationDbContext, ApplicationUser>()
           .AddAuthentication();

        // Add MVC services to the services container
        services.AddMvc();
    });

    // Enable Browser Link support
    app.UseBrowserLink();

    // Add static files to the request pipeline
    app.UseStaticFiles();

    // Add cookie-based authentication to the request pipeline
    app.UseCookieAuthentication(new CookieAuthenticationOptions
    {
        AuthenticationType = ClaimsIdentityOptions.DefaultAuthenticationType,
        LoginPath = new PathString("/Account/Login"),
    });

    // Add MVC to the request pipeline
    app.UseMvc(routes =>
    {
        routes.MapRoute(
            name: "default", 
            template: "{controller}/{action}/{id?}",
            defaults: new { controller = "Home", action = "Index" });

        routes.MapRoute(
            name: "api",
            template: "{controller}/{id?}");
    });
}

Где я могу получить доступ кHttpConfiguration например, чтобы я мог установитьCamelCasePropertyNamesContractResolverтак же, как я сделал в WebApi 2:

var formatterSettings = config.Formatters.JsonFormatter.SerializerSettings;
formatterSettings.Formatting = Formatting.None;
formatterSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();

Ответы на вопрос(2)

Ваш ответ на вопрос