public List <Contestant> getAllContestants() { sendRequest(new GetContestantsRequest()); Response response = readResponse(); if (response is GetContestantsResponse) { GetContestantsResponse resp = (GetContestantsResponse)response; IList <Contestant> contestants = new List <Contestant>(); foreach (ContestantDTO c in resp.ContestantDTOs) { contestants.Add(DTOUtils.getFromDTO(c)); } return((List <Contestant>)contestants); } return(null); }
public List <Contestant> getContestantsByTeam(string team) { sendRequest(new GetContestantsRequest()); Response response = readResponse(); if (response is GetContestantsResponse) { GetContestantsResponse resp = (GetContestantsResponse)response; IList <Contestant> contestants = new List <Contestant>(); foreach (ContestantDTO c in resp.ContestantDTOs) { if (c.Team.Equals(team)) { contestants.Add(DTOUtils.getFromDTO(c)); } } return((List <Contestant>)contestants); } return(null); }