Esempio n. 1
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>();
        }
Esempio n. 2
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>();
        }
Esempio n. 3
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 ?? throw new ArgumentNullException(nameof(store));
     _roleValidators  = roleValidators ?? throw new ArgumentNullException(nameof(roleValidators));
     _keyNormalizer   = keyNormalizer ?? throw new ArgumentNullException(nameof(keyNormalizer));
     _errors          = errors ?? throw new ArgumentNullException(nameof(errors));
     _logger          = logger ?? throw new ArgumentNullException(nameof(logger));
     _contextAccessor = contextAccessor ?? throw new ArgumentNullException(nameof(contextAccessor));
     _uow             = uow ?? throw new ArgumentNullException(nameof(uow));
     _users           = _uow.Set <User>();
 }
        //private readonly DbSet<User> _users;

        public ApplicationRoleManager(
            IApplicationRoleStore store,
            IEnumerable <IRoleValidator <Role> > roleValidators,
            ILookupNormalizer keyNormalizer,
            IdentityErrorDescriber errors,
            ILogger <ApplicationRoleManager> logger,
            IHttpContextAccessor contextAccessor,
            IUserRepository repository) :
            base((RoleStore <Role, ApplicationDbContext, int, UserRole, RoleClaim>)store, roleValidators, keyNormalizer, errors, logger)
        {
            _store           = store ?? throw new ArgumentNullException(nameof(_store));
            _roleValidators  = roleValidators ?? throw new ArgumentNullException(nameof(_roleValidators));
            _keyNormalizer   = keyNormalizer ?? throw new ArgumentNullException(nameof(_keyNormalizer));
            _errors          = errors ?? throw new ArgumentNullException(nameof(_errors));
            _logger          = logger ?? throw new ArgumentNullException(nameof(_logger));
            _contextAccessor = contextAccessor ?? throw new ArgumentNullException(nameof(_contextAccessor));
            _repository      = repository ?? throw new ArgumentNullException(nameof(_repository));
            //_users = _repository.Set<User>();
        }
 public ApplicationRoleManager(IApplicationRoleStore store) : base((ApplicationRoleStore)store)
 {
 }