コード例 #1
0
        public UserService(
            IUserStoreService userStoreService,
            IUserTokenStorageService userTokenStorageService,
            IOptions <IdentityOptions> optionsAccessor,
            IPasswordHasher <User> passwordHasher,
            IEnumerable <IUserValidator <User> > userValidators,
            IEnumerable <IPasswordValidator <User> > passwordValidators,
            ILookupNormalizer keyNormalizer,
            ISecurityService securityService,
            IdentityErrorDescriber identityErrorDescriber,
            IServiceProvider serviceProvider,
            ILogger <UserService> logger,
            IHttpContextAccessor httpContextAccessor,
            IUnitOfWork unitOfWork,
            IEmailService emailService,
            IAntiForgeryCookieService antiForgeryCookieService,
            IOptionsSnapshot <SiteSettings> options,
            IUsedPasswordService usedPasswordService,
            IUserTokenFactoryService userTokenFactoryService,
            IMapper mapper)
            : base((IUserStore <User>)userStoreService, optionsAccessor, passwordHasher, userValidators, passwordValidators, keyNormalizer, identityErrorDescriber, serviceProvider, logger)
        {
            _userStoreService = userStoreService;
            _userStoreService.CheckArgumentIsNull(nameof(_userStoreService));

            _userTokenStorageService = userTokenStorageService;
            _userTokenStorageService.CheckArgumentIsNull(nameof(_userTokenStorageService));

            _optionsAccessor = optionsAccessor;
            _optionsAccessor.CheckArgumentIsNull(nameof(_optionsAccessor));

            _passwordHasher = passwordHasher;
            _passwordHasher.CheckArgumentIsNull(nameof(_passwordHasher));

            _userValidators = userValidators;
            _userValidators.CheckArgumentIsNull(nameof(_userValidators));

            _passwordValidators = passwordValidators;
            _passwordValidators.CheckArgumentIsNull(nameof(_passwordValidators));

            _keyNormalizer = keyNormalizer;
            _keyNormalizer.CheckArgumentIsNull(nameof(_keyNormalizer));

            _securityService = securityService;
            _securityService.CheckArgumentIsNull(nameof(_securityService));

            _identityErrorDescriber = identityErrorDescriber;
            _identityErrorDescriber.CheckArgumentIsNull(nameof(_identityErrorDescriber));

            _serviceProvider = serviceProvider;
            _serviceProvider.CheckArgumentIsNull(nameof(_serviceProvider));

            _logger = logger;
            _logger.CheckArgumentIsNull(nameof(_logger));

            _stringEncryption = new StringEncryption();
            _stringEncryption.CheckArgumentIsNull(nameof(_stringEncryption));

            _httpContextAccessor = httpContextAccessor;
            _httpContextAccessor.CheckArgumentIsNull(nameof(_httpContextAccessor));

            _unitOfWork = unitOfWork;
            _unitOfWork.CheckArgumentIsNull(nameof(_unitOfWork));

            _usedPasswordService     = usedPasswordService;
            _userTokenFactoryService = userTokenFactoryService;
            _mapper = mapper;
            _usedPasswordService.CheckArgumentIsNull(nameof(_usedPasswordService));

            _antiForgeryCookieService = antiForgeryCookieService;
            _antiForgeryCookieService.CheckArgumentIsNull(nameof(_antiForgeryCookieService));

            _emailService = emailService;
            _emailService.CheckArgumentIsNull(nameof(_emailService));

            options.CheckArgumentIsNull(nameof(options));
            _options      = options;
            _smsTemplates = options.Value.SmsTemplates;

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