public IActionResult AddAdventure() { var adv = new AdventureListVm(); List <Adventure> advList = _repo.GetAll(); var list = new List <SelectListItem>(); foreach (var item in advList) { list.Add(new SelectListItem { Value = item.Id.ToString(), Text = item.Name }); } adv.AllAdventures = list; return(View(adv)); }
public IActionResult AddAdventure(AdventureListVm al) { _repo.Add(al.Adventure); return(View("adventureadded")); }