// 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, WorldContextSeedData seeder) { Mapper.Initialize(config => { config.CreateMap <TripViewModel, Trip>().ReverseMap(); config.CreateMap <StopViewModel, Stop>().ReverseMap(); }); // "Production" may not be setup at the moment. if (env.IsProduction() == false) { app.UseDeveloperExceptionPage(); loggerFactory.AddDebug(LogLevel.Information); } else { loggerFactory.AddDebug(LogLevel.Error); } app.UseStaticFiles(); app.UseMvc(config => { config.MapRoute( name: "Default", template: "{controller}/{action}/{id?}", defaults: new { controller = "App", action = "Index" }); }); seeder.EnsureSeeData().Wait(); }