public AuthRepository() { _ctx = new AuthContext.AuthContext(); _userManager = new UserManager <ApplicationUser>(new UserStore <ApplicationUser>(_ctx)); _userManager.UserValidator = new UserValidator <ApplicationUser>(_userManager) { AllowOnlyAlphanumericUserNames = false, RequireUniqueEmail = true }; _roleManager = new RoleManager <IdentityRole>(new RoleStore <IdentityRole>(_ctx)); }
static RegisterRoles() { _ctx = new AuthContext.AuthContext(); _userManager = new UserManager <ApplicationUser>(new UserStore <ApplicationUser>(_ctx)); _roleManager = new RoleManager <IdentityRole>(new RoleStore <IdentityRole>(_ctx)); }