public Team GetTeamById(int id) { var item = teamsRepository.GetTeam(id); if (item == null) { throw new ObjectNotFoundException(string.Format("Team with id '{0}' not found", id)); } return(item); }
public IActionResult GetTeam(int teamId) { try { var team = _teamRepository.GetTeam(teamId); if (team == null) { return(StatusCode(StatusCodes.Status404NotFound, $"Team with Id {teamId} doesn't exists")); } return(Ok(team)); } catch (Exception ex) { return(StatusCode(StatusCodes.Status500InternalServerError, ex.ToString())); } }
public async Task <BL.Models.Team> GetTeam(int id) { var team = await _teamsRepository.GetTeam(id); return(team); }
public Team GetTeam(int id) { return(_teamsRepository.GetTeam(id)); }