Beispiel #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, ILoggerFactory loggerFactory, AppSeed seeder)
        {
            loggerFactory.AddConsole();

            if (env.IsDevelopment())
            {
                seeder.SeedData().Wait();
                app.UseDeveloperExceptionPage();
                loggerFactory.AddDebug(LogLevel.Information);
            }

            Mapper.Initialize(config =>
            {
                config.CreateMap <UserViewModel, User>().ReverseMap();
            });

            app.UseStaticFiles();
            app.UseMvc(configureRoutes =>
            {
                configureRoutes.MapRoute(
                    name: "Default",
                    template: "{controller}/{action}/{id?}",
                    defaults: new { controller = "App", action = "index" }
                    );
            });
        }