コード例 #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, CoditoContext coditoContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }

            // Seed DB
            coditoContext.DataSeed();

            // Configure API
            app.UseHttpsRedirection();
            app.UseExceptionHandlerWithProblemJson();
            app.UseStatusCodePagesWithReExecute("/errors/{0}");
            app.UseMvc();
            app.UseOpenApi();
            // Configure Automapper
            AutoMapperConfig.Initialize();
        }