Esempio n. 1
0
        public DiTestController(
            // the Microsoft.AspNetCore.Identity User and Role Manager classes
            RoleManager <IdentityRole> roleManager,
            UserManager <ApplicationUser> userManager,

            IIdentityDatabaseContext <ApplicationUser, IdentityRole, string> identityDatabaseContext,

            // if want to use with SOLID and Interface Segregation Principle, then can just use the specific interface that need

            // these interfaces are all implemented by UserStore
            IUserStore <ApplicationUser> userStore,
            IUserLoginStore <ApplicationUser> userLoginStore,
            IUserRoleStore <ApplicationUser> userRoleStore,
            IUserClaimStore <ApplicationUser> userClaimStore,
            IUserPasswordStore <ApplicationUser> userPasswordStore,
            IUserSecurityStampStore <ApplicationUser> userSecurityStampStore,
            IUserEmailStore <ApplicationUser> userEmailStore,
            IUserLockoutStore <ApplicationUser> userLockoutStore,
            IUserPhoneNumberStore <ApplicationUser> userPhoneNumberStore,
            IUserTwoFactorStore <ApplicationUser> userTwoFactorStore,
            IQueryableUserStore <ApplicationUser> queryableUserStore,

            // these interfaces are all implemented by RoleStore
            IRoleStore <IdentityRole> roleStore,
            IRoleClaimStore <IdentityRole> roleClaimStore,
            IQueryableRoleStore <IdentityRole> queryableRoleStore
            )
        {
            _roleManager = roleManager;
            _userManager = userManager;

            _identityDatabaseContext = identityDatabaseContext;
            _userStore              = userStore;
            _userLoginStore         = userLoginStore;
            _userRoleStore          = userRoleStore;
            _userClaimStore         = userClaimStore;
            _userPasswordStore      = userPasswordStore;
            _userSecurityStampStore = userSecurityStampStore;
            _userEmailStore         = userEmailStore;
            _userLockoutStore       = userLockoutStore;
            _userPhoneNumberStore   = userPhoneNumberStore;
            _userTwoFactorStore     = userTwoFactorStore;
            _queryableUserStore     = queryableUserStore;

            _roleStore          = roleStore;
            _roleClaimStore     = roleClaimStore;
            _queryableRoleStore = queryableRoleStore;
        }
Esempio n. 2
0
 public UserManager(IQueryableUserStore <User, Guid> store)
     : base(store)
 {
 }