public ApplicationRoleManager(
            IRoleStore <AppRole> store,
            ILookupNormalizer keyNormalizer,
            ILogger <ApplicationRoleManager> logger,
            IEnumerable <IRoleValidator <AppRole> > roleValidators,
            IdentityErrorDescriber errors,
            IApplicationUserManager userManager) :
            base(store, roleValidators, keyNormalizer, errors, logger)
        {
            _errors = errors;
            _errors.CheckArgumentIsNull(nameof(_errors));

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

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

            _store = store;
            _store.CheckArgumentIsNull(nameof(_store));

            _roleValidators = roleValidators;
            _roleValidators.CheckArgumentIsNull(nameof(_roleValidators));

            _userManager = userManager;
            _userManager.CheckArgumentIsNull(nameof(_userManager));
        }
Exemple #2
0
        public ApplicationRoleManager(
            IApplicationRoleStore store,
            IEnumerable <IRoleValidator <Role> > roleValidators,
            ILookupNormalizer keyNormalizer,
            IdentityErrorDescriber errors,
            ILogger <ApplicationRoleManager> logger,
            IHttpContextAccessor contextAccessor,
            IUnitOfWork uow) :
            base((RoleStore <Role, ApplicationDbContext, int, UserRole, RoleClaim>)store, roleValidators, keyNormalizer, errors, logger)
        {
            _store = store;
            _store.CheckArgumentIsNull(nameof(_store));

            _roleValidators = roleValidators;
            _roleValidators.CheckArgumentIsNull(nameof(_roleValidators));

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

            _errors = errors;
            _errors.CheckArgumentIsNull(nameof(_errors));

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

            _contextAccessor = contextAccessor;
            _contextAccessor.CheckArgumentIsNull(nameof(_contextAccessor));

            _uow = uow;
            _uow.CheckArgumentIsNull(nameof(_uow));

            _users = _uow.Set <User>();
        }
        public RoleService(
            IRoleStoreService roleStoreService,
            IEnumerable <IRoleValidator <Role> > roleValidators,
            ILookupNormalizer lookupNormalizer,
            IdentityErrorDescriber errors,
            ILogger <RoleService> logger,
            IHttpContextAccessor httpContextAccessor,
            IUnitOfWork unitOfWork) :
            base((RoleStore <Role, ApplicationDbContext, Guid, UserRole, RoleClaim>)roleStoreService, roleValidators, lookupNormalizer, errors, logger)
        {
            _roleStoreService = roleStoreService;
            _roleStoreService.CheckArgumentIsNull(nameof(_roleStoreService));

            _roleValidators = roleValidators;
            _roleValidators.CheckArgumentIsNull(nameof(_roleValidators));

            _lookupNormalizer = lookupNormalizer;
            _lookupNormalizer.CheckArgumentIsNull(nameof(_lookupNormalizer));

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

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

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

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

            _roles = _unitOfWork.Set <Role>();
            _users = _unitOfWork.Set <User>();
        }
Exemple #4
0
        public ApplicationRoleManager(
            IApplicationRoleStore store,
            IEnumerable <IRoleValidator <Role> > roleValidators,
            ILookupNormalizer keyNormalizer,
            IdentityErrorDescriber errors,
            ILogger <ApplicationRoleManager> logger,
            IHttpContextAccessor contextAccessor,
            IUnitOfWork uow, IHttpContextAccessor contextAccessor1) :
            base((RoleStore <Role, ApplicationDbContext, int, UserRole, RoleClaim>)store, roleValidators, keyNormalizer, errors, logger, contextAccessor)
        {
            _contextAccessor = contextAccessor1;

            store.CheckArgumentIsNull(nameof(store));

            roleValidators.CheckArgumentIsNull(nameof(roleValidators));

            keyNormalizer.CheckArgumentIsNull(nameof(keyNormalizer));

            errors.CheckArgumentIsNull(nameof(errors));

            logger.CheckArgumentIsNull(nameof(logger));

            contextAccessor.CheckArgumentIsNull(nameof(contextAccessor));

            uow.CheckArgumentIsNull(nameof(uow));

            _users = uow.Set <User>();
        }
        public ApplicationUserManager(
            IApplicationUserStore store,
            IOptions <IdentityOptions> optionsAccessor,
            IPasswordHasher <User> passwordHasher,
            IEnumerable <IUserValidator <User> > userValidators,
            IEnumerable <IPasswordValidator <User> > passwordValidators,
            ILookupNormalizer keyNormalizer,
            IdentityErrorDescriber errors,
            IServiceProvider services,
            ILogger <ApplicationUserManager> logger,
            IHttpContextAccessor contextAccessor,
            IUnitOfWork uow,
            IUsedPasswordsService usedPasswordsService)
            : base((UserStore <User, Role, ApplicationDbContext, long, UserClaim, UserRole, UserLogin, UserToken, RoleClaim>)store, optionsAccessor, passwordHasher, userValidators, passwordValidators, keyNormalizer, errors, services, logger)
        {
            _userStore = store;
            _userStore.CheckArgumentIsNull(nameof(_userStore));

            _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));

            _errors = errors;
            _errors.CheckArgumentIsNull(nameof(_errors));

            _services = services;
            _services.CheckArgumentIsNull(nameof(_services));

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

            _contextAccessor = contextAccessor;
            _contextAccessor.CheckArgumentIsNull(nameof(_contextAccessor));

            _uow = uow;
            _uow.CheckArgumentIsNull(nameof(_uow));

            _usedPasswordsService = usedPasswordsService;
            _usedPasswordsService.CheckArgumentIsNull(nameof(_usedPasswordsService));

            _users     = uow.Set <User>();
            _roles     = uow.Set <Role>();
            _userRoles = uow.Set <UserRole>();
        }
Exemple #6
0
        public IdentityDataInitializerService(
            IUnitOfWork unitOfWork,
            ISecurityService securityService,
            IUserService userService,
            IServiceScopeFactory scopeFactory,
            IRoleService roleService,
            ILookupNormalizer keyNormalizer,
            IOptionsSnapshot <SiteSettings> options,
            ILogger <IdentityDataInitializerService> logger
            )
        {
            _unitOfWork = unitOfWork;
            _unitOfWork.CheckArgumentIsNull(nameof(_unitOfWork));

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

            _userService = userService;
            _userService.CheckArgumentIsNull(nameof(_userService));

            _scopeFactory = scopeFactory;
            _scopeFactory.CheckArgumentIsNull(nameof(_scopeFactory));

            _roleService = roleService;
            _roleService.CheckArgumentIsNull(nameof(_roleService));

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

            _options = options;
            _options.CheckArgumentIsNull(nameof(_options));

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

            _users      = _unitOfWork.Set <User>();
            _roles      = _unitOfWork.Set <Role>();
            _groups     = _unitOfWork.Set <Group>();
            _groupRoles = _unitOfWork.Set <GroupRole>();
            _userRoles  = _unitOfWork.Set <UserRole>();
        }
        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>();
        }