private async Task ValidateTeamAsync(long teamId) { var team = await _footballRepository.GetTeamAsync(teamId); if (team == null) { throw new NotFoundItemException($"The team with id: {teamId} does not exists."); } }
public async Task <TeamWithPlayerModel> GetTeamAsync(long teamId) { var team = await _foootballRepository.GetTeamAsync(teamId); if (team == null) { throw new NotFoundItemException($"The team with id: {teamId} does not exists."); } return(_mapper.Map <TeamWithPlayerModel>(team)); }