// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, WorldContextSeed seeder) { //app.UseDefaultFiles(); app.UseStaticFiles(); Mapper.Initialize(config => { config.CreateMap <EventViewModel, Event>().ReverseMap(); }); //var mp = new MapperConfiguration(cfg => //{ // //cfg.AddProfile<AppProfile>(); // cfg.CreateMap<EventViewModel, Event>().ReverseMap(); //}); app.UseMvc(config => { config.MapRoute( name: "Default", template: "{controller}/{action}/{id?}", defaults: new { controller = "App", action = "Index" } ); }); seeder.EnsureSeedData(); }
// 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, WorldContextSeed seeder) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); app.UseApplicationInsightsRequestTelemetry(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseBrowserLink(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseApplicationInsightsExceptionTelemetry(); app.UseStaticFiles(); app.UseSession(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); seeder.EnsureSeedData().Wait(); }