public async Task <ActionResult> Delete(int userId) { try { if (!_supervisor.UserExists(userId)) { return(NotFound()); } if (!await _supervisor.DeleteUserAsync(userId)) { return(StatusCode(StatusCodes.Status500InternalServerError, "Error in remove User")); } return(NoContent()); } catch (Exception ex) { _logger.LogError(ex, "Exception: "); return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message)); } }