public async Task <IActionResult> DeleteTeam(int?id) { int result = 0; if (id == null) { return(BadRequest()); } try { result = await league.DeleteTeam(id); if (result == 0) { return(NotFound()); } return(Ok()); } catch (Exception) { return(BadRequest()); } }