Example #1
0
        public async Task <IActionResult> Index(int championshipID)
        {
            var championships = await _championships.GetChampionships();

            var seasonIndex = await _seasons.GetSeasonIndexListOfChampionship(championshipID);

            var viewModel = new SeasonIndexModel()
            {
                ChampionshipID   = championshipID,
                ChampionshipName = championships.FirstOrDefault(e => e.ActiveChampionship).ChampionshipName,
                AllChampionships = championships.ToDictionary(e => e.ChampionshipId, e => e.ChampionshipName),
                SeasonIndex      = seasonIndex
            };

            return(View("Index", viewModel));
        }
Example #2
0
        public async Task <IActionResult> Index(string message = null)
        {
            bool   championship  = false;
            string name          = "Formula";
            var    championships = await _championships.GetChampionships();

            if (championships.Count > 0)
            {
                championship = true;
                var champname = championships.FirstOrDefault(c => c.ActiveChampionship);
                name = champname.ChampionshipName;
            }

            var viewModel = new HomeViewModel
            {
                ChampionshipName = name,
                Message          = message,
                ChampExists      = championship
            };

            return(View(viewModel));
        }
Example #3
0
 public async Task <IActionResult> Index()
 {
     return(View(await _champService.GetChampionships()));
 }