public List <StadiumViewModel> GetStadiums()
        {
            var stadiums = _stadiumService.GetAllStadiums();
            var svm      = new List <StadiumViewModel>();

            foreach (Stadium stadium in stadiums)
            {
                svm.Add(
                    new StadiumViewModel
                {
                    StadiumId    = stadium.StadiumId,
                    StadiumName  = stadium.StadiumName,
                    Location     = stadium.Location,
                    BuildDate    = stadium.BuildDate,
                    StadiumImage = stadium.StadiumImage,
                    ClubName     = _stadiumService.GetSingleClubByClubId(stadium.ClubId).ClubName
                });
            }

            return(svm);
        }
Esempio n. 2
0
        public IActionResult EditClub(int Id)
        {
            ViewBag.Stadiums = _StadiumService.GetAllStadiums();

            return(View(_ClubService.GetSingleClubById(Id)));
        }