public async Task ChangeLockStatusAsync(UserLockModel model) { var user = await userManager.FindByIdAsync(model.Id); if (model.IsLock) { user.LockoutEnd = null; } else { user.LockoutEnd = DateTime.Now.AddYears(100); await LogOutAsync(user); } await userManager.UpdateAsync(user); }
public async Task <IActionResult> Lock(UserLockModel model) { await userService.ChangeLockStatusAsync(model); return(Ok()); }