Exemple #1
0
        public IEnumerable <WinnerModel> Get(int compId)
        {
            var results = TrophyRepository.GetWinnersForCompetition(compId)
                          .ToList()
                          .Select(w => ModelFactory.Create(w));

            return(results);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 public CompetitionModel Get(int id)
 {
     return(ModelFactory.Create(TrophyRepository.GetCompetition(id)));
 }
Exemple #4
0
        public WinnerModel Get(int compId, int id)
        {
            var result = ModelFactory.Create(TrophyRepository.GetWinner(id));

            return(result);
        }