Example #1
0
        public async Task <IActionResult> Index()
        {
            ViewData["Title"] = "Home page";
            var prizes = await _prizes.GetPrizes();


            var model = new HomeModel()
            {
                Prizes = prizes
                         .GroupBy(_categorizationService.GetCategory, new CategoryComparer())
                         .OrderByDescending(g => g.Key.Order),
            };

            return(View(model));
        }
Example #2
0
        public async Task <IActionResult> GetAllPrizes()
        {
            var prizes = await _prizes.GetPrizes();

            return(Ok(prizes));
        }