public async Task <IActionResult> DisableUser([FromRoute] string userId, [FromBody] bool disable) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { await _repository.DisableUserLockEndDate(userId, disable); var currentUser = _repository.Get(userId); return(CreatedAtAction("Get", new { id = currentUser.Id }, currentUser)); } catch (DbUpdateConcurrencyException e) { if (!ApplicationUserExists(userId)) { return(NotFound()); } throw; } return(null); }