public async Task <object> LockUser(int userid) { try { var model = await _repoRoleUser.FindAll().FirstOrDefaultAsync(x => x.UserID == userid); // if (model.Status == true) { // model.Status = false; // } else { // model.Status = true; // } model.Status = !model.Status; await _repoRoleUser.SaveAll(); return(new { status = true, message = "Lock User Successfully!" }); } catch (System.Exception) { return(new { status = false, message = "Failed on Block!" }); } }