コード例 #1
0
 public UserService(
     IUnitOfWork uow,
     IEventBus bus,
     IUserPasswordHashAlgorithm password,
     IMapper mapper) : base(uow, bus)
 {
     _mapper   = mapper ?? throw new ArgumentNullException(nameof(mapper));
     _password = password ?? throw new ArgumentNullException(nameof(password));
 }
コード例 #2
0
 public UserService(
     IDbContext dbContext,
     IEventBus bus,
     IUserPasswordHashAlgorithm password,
     IMapper mapper) : base(dbContext, bus)
 {
     _mapper   = mapper ?? throw new ArgumentNullException(nameof(mapper));
     _password = password ?? throw new ArgumentNullException(nameof(password));
 }
コード例 #3
0
 public DbSetup(IDbContext dbContext,
                IOptionsSnapshot <ProjectOptions> settings,
                IUserPasswordHashAlgorithm password,
                ILogger <DbSetup> logger)
 {
     _dbContext = dbContext ?? throw new ArgumentNullException(nameof(dbContext));
     _settings  = settings ?? throw new ArgumentNullException(nameof(settings));
     _password  = password ?? throw new ArgumentNullException(nameof(password));
     _logger    = logger ?? throw new ArgumentNullException(nameof(logger));
 }
コード例 #4
0
 public DbSetup(IUnitOfWork uow,
                IOptionsSnapshot <ProjectSettings> settings,
                IUserPasswordHashAlgorithm password,
                ILogger <DbSetup> logger)
 {
     _uow      = uow ?? throw new ArgumentNullException(nameof(uow));
     _settings = settings ?? throw new ArgumentNullException(nameof(settings));
     _password = password ?? throw new ArgumentNullException(nameof(password));
     _logger   = logger ?? throw new ArgumentNullException(nameof(logger));
 }
コード例 #5
0
        public AuthenticationService(
            IMessageLocalizer localizer,
            IHttpContextAccessor httpContext,
            IUserSession session,
            ILogger <AuthenticationService> logger,
            IConfiguration configuration,
            IUnitOfWork uow,
            IUserPasswordHashAlgorithm password)
        {
            _localizer     = localizer ?? throw new ArgumentNullException(nameof(localizer));
            _uow           = uow ?? throw new ArgumentNullException(nameof(uow));
            _httpContext   = httpContext ?? throw new ArgumentNullException(nameof(httpContext));
            _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
            _session       = session ?? throw new ArgumentNullException(nameof(session));
            _logger        = logger ?? throw new ArgumentNullException(nameof(logger));
            _password      = password ?? throw new ArgumentNullException(nameof(password));

            _roles = _uow.Set <Role>();
            _users = _uow.Set <User>();
        }
コード例 #6
0
        public AuthenticationService(
            ITokenManager token,
            IUnitOfWork uow,
            IAntiforgeryService antiforgery,
            IOptionsSnapshot <TokenOptions> options,
            IMessageLocalizer localizer,
            IUserPasswordHashAlgorithm password,
            IUserSession session)
        {
            _token       = token ?? throw new ArgumentNullException(nameof(token));
            _uow         = uow ?? throw new ArgumentNullException(nameof(uow));
            _antiforgery = antiforgery ?? throw new ArgumentNullException(nameof(antiforgery));
            _options     = options ?? throw new ArgumentNullException(nameof(options));
            _localizer   = localizer ?? throw new ArgumentNullException(nameof(localizer));
            _password    = password ?? throw new ArgumentNullException(nameof(password));
            _session     = session ?? throw new ArgumentNullException(nameof(session));

            _users = _uow.Set <User>();
            _roles = _uow.Set <Role>();
        }
コード例 #7
0
        public AuthenticationService(
            ITokenService token,
            IDbContext dbContext,
            IAntiXsrf antiXsrf,
            IOptionsSnapshot <TokenOptions> options,
            ITranslationService translation,
            IUserPasswordHashAlgorithm password,
            IUserSession session)
        {
            _token       = token ?? throw new ArgumentNullException(nameof(token));
            _antiXsrf    = antiXsrf ?? throw new ArgumentNullException(nameof(antiXsrf));
            _options     = options ?? throw new ArgumentNullException(nameof(options));
            _translation = translation ?? throw new ArgumentNullException(nameof(translation));
            _password    = password ?? throw new ArgumentNullException(nameof(password));
            _session     = session ?? throw new ArgumentNullException(nameof(session));
            Ensure.IsNotNull(dbContext, nameof(dbContext));

            _users = dbContext.Set <User>();
            _roles = dbContext.Set <Role>();
        }
コード例 #8
0
        public AuthenticationService(
            ITokenService token,
            IDbContext dbContext,
            IAntiXsrf antiforgery,
            IOptionsSnapshot <TokenOptions> options,
            IMessageLocalizer localizer,
            IUserPasswordHashAlgorithm password,
            IUserSession session)
        {
            _token       = token ?? throw new ArgumentNullException(nameof(token));
            _dbContext   = dbContext ?? throw new ArgumentNullException(nameof(dbContext));
            _antiforgery = antiforgery ?? throw new ArgumentNullException(nameof(antiforgery));
            _options     = options ?? throw new ArgumentNullException(nameof(options));
            _localizer   = localizer ?? throw new ArgumentNullException(nameof(localizer));
            _password    = password ?? throw new ArgumentNullException(nameof(password));
            _session     = session ?? throw new ArgumentNullException(nameof(session));

            _users = _dbContext.Set <User>();
            _roles = _dbContext.Set <Role>();
        }
コード例 #9
0
        public AuthenticationService(
            IMessageLocalizer localizer,
            IHttpContextAccessor httpContext,
            IUserSession session,
            ILogger <AuthenticationService> logger,
            IConfiguration configuration,
            IDbContext dbContext,
            IUserPasswordHashAlgorithm password,
            IAntiXsrf antiXsrf)
        {
            _localizer     = localizer ?? throw new ArgumentNullException(nameof(localizer));
            _httpContext   = httpContext ?? throw new ArgumentNullException(nameof(httpContext));
            _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
            _session       = session ?? throw new ArgumentNullException(nameof(session));
            _logger        = logger ?? throw new ArgumentNullException(nameof(logger));
            _password      = password ?? throw new ArgumentNullException(nameof(password));
            _antiXsrf      = antiXsrf ?? throw new ArgumentNullException(nameof(password));

            Ensure.IsNotNull(dbContext, nameof(dbContext));

            _roles = dbContext.Set <Role>();
            _users = dbContext.Set <User>();
        }