MVC 5 Identity 2.0 lockout doesn't work
问题 I need to block a user permanently. I don't understand why this code is not working. This line UserManager.IsLockedOut(user.Id); always returns false instead of true . Maybe it's necessary to put this line UserManager.UserLockoutEnabledByDefault = true; in user registration stage? using (var _db = new ApplicationDbContext()) { UserStore<DALApplicationUser> UserStore = new UserStore<DALApplicationUser>(_db); UserManager<DALApplicationUser> UserManager = new UserManager<DALApplicationUser>