public IActionResult Buy() { IEnumerable <ConcertModel> concerts = _concertQuery.GetConcerts(); IList <SelectListItem> selectListItems = new List <SelectListItem>(); foreach (var concert in concerts) { selectListItems.Add(new SelectListItem { Value = concert.Id.ToString(), Text = concert.Title }); } return(View(new BuyTicketsViewModel() { ConcertIds = selectListItems })); }
public IActionResult Index() { return(View(_query.GetConcerts())); }