// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, KbvbContext kbvbContext) { if (env.IsDevelopment()) { KbvbContextExtensions.EnsureSeeded(kbvbContext); app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler(); } AutoMapper.Mapper.Initialize(cfg => { cfg.CreateMap <Player, PlayerDto>(); cfg.CreateMap <User, UserDto>(); cfg.CreateMap <User, UserForCreationDto>() .ForMember(dest => dest.FirstName, opt => opt.MapFrom(src => src.FirstName)) .ForMember(dest => dest.LastName, opt => opt.MapFrom(src => src.LastName)); }); app.UseMvc(); }
public UserRepository(KbvbContext context) { _context = context; }
public PlayerRepository(KbvbContext context) { _context = context; }