public IEnumerable <WinnerModel> Get(int compId) { var results = TrophyRepository.GetWinnersForCompetition(compId) .ToList() .Select(w => ModelFactory.Create(w)); return(results); }
public IEnumerable <CompetitionModel> Get() { // get the data from the repository var results = TrophyRepository.GetAllCompetitions() .OrderBy(c => c.Name) .Take(25) .ToList() .Select(c => ModelFactory.Create(c)); // return the results return(results); }
public CompetitionModel Get(int id) { return(ModelFactory.Create(TrophyRepository.GetCompetition(id))); }
public WinnerModel Get(int compId, int id) { var result = ModelFactory.Create(TrophyRepository.GetWinner(id)); return(result); }