// 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, EFDbContext context, IServiceProvider serviceProvider) { loggerFactory.AddConsole(); loggerFactory.AddDebug(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler(appBuilder => { appBuilder.Run(async contextBuilder => { contextBuilder.Response.StatusCode = 500; await contextBuilder.Response.WriteAsync("An unexpected fault happend. Try again later."); }); }); } AutoMapper.Mapper.Initialize(cfg => { cfg.CreateMap <Employee, EmployeeDdd>(); cfg.CreateMap <EmployeeDdd, Employee>(); cfg.CreateMap <AuthDataDdd, AuthData>(); cfg.CreateMap <Skill, SkillDdd>(); cfg.CreateMap <SkillDdd, Skill>(); cfg.CreateMap <Skill, SkillViewModel>(); cfg.CreateMap <SkillViewModel, Skill>(); cfg.CreateMap <EmployeeViewModel, Employee>(); cfg.CreateMap <AuthDataViewModel, AuthData>(); cfg.CreateMap <Employee, UserDataViewModel>(); cfg.CreateMap <AuthData, UserDataViewModel>().ForMember(src => src.Email, dest => dest.MapFrom(x => x.Email)); }); app.UseStaticFiles(); app.UseSession(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); DbInitalizer.Initalize(context); }