Ejemplo n.º 1
0
        public async Task <IActionResult> Index(string team)
        {
            var currentTeam = await _teamService.GetAsync(team);

            var sections = await _sectionService.GetAllByStadiumAsync(currentTeam.StadiumId);

            var season = await _seasonService.GetNextSeasonAsync();

            List <SectionVM> sectionVMs = _mapper.Map <List <SectionVM> >(sections);

            foreach (var item in sectionVMs)
            {
                item.Price = item.Price * currentTeam.SubscriptionPrice;
            }

            SubscriptionSectionVM listVM = new SubscriptionSectionVM
            {
                TeamName   = currentTeam.Name,
                TeamLogo   = currentTeam.Logo,
                StartDate  = season.StartDate,
                EndDate    = season.EndDate,
                SectionVMs = sectionVMs
            };

            return(View(listVM));
        }