Esempio n. 1
0
 public UserService(PlayerStatsDbContext dbContext, IMapper mapper, ILogger <UserService> logger, IPasswordHasher <User> passwordHasher, AutheticationSettings autheticationSettings)
 {
     _dbContext             = dbContext;
     _mapper                = mapper;
     _logger                = logger;
     _passwordHasher        = passwordHasher;
     _autheticationSettings = autheticationSettings;
 }
Esempio n. 2
0
        public CreateUserDtoValidator(PlayerStatsDbContext dbContext)
        {
            RuleFor(x => x.EmailAddress).NotEmpty().EmailAddress();

            RuleFor(x => x.Password).MinimumLength(6);

            RuleFor(x => x.ConfirmPassword).Equal(e => e.Password);

            RuleFor(x => x.EmailAddress)
            .Custom((value, context) =>
            {
                var emailInUse = dbContext.User.Any(u => u.EmailAddress == value);
                if (emailInUse)
                {
                    context.AddFailure("EmailAdress", "That email is taken");
                }
            });
        }
 public PlayerStatsSeeder(PlayerStatsDbContext dbContext)
 {
     _dbContext = dbContext;
 }
Esempio n. 4
0
 public CategoryService(PlayerStatsDbContext dbContext, IMapper mapper, ILogger <Category> logger)
 {
     _dbContext = dbContext;
     _mapper    = mapper;
     _logger    = logger;
 }
Esempio n. 5
0
 public GameService(PlayerStatsDbContext dbContext, IMapper mapper, ILogger <GameService> logger)
 {
     _dbContext = dbContext;
     _mapper    = mapper;
     _logger    = logger;
 }