// GET: ReservationController/Create public ActionResult Create() { var reservationTypes = _ReservationTyperepo.GetAll(); var resrvTypesItems = reservationTypes.Select(x => new SelectListItem { Text = x.NameType, Value = x.Id.ToString() }).ToList(); var model = new CreateReservationViewModel { ReservationTypes = resrvTypesItems }; return(View(model)); }
// GET: ReservationTypeController public ActionResult Index() { var reservationTypes = _repo.GetAll(); var model = reservationTypes.Select(a => new ReservationTypeViewModel() { Id = a.Id, Name = a.Name, Number = a.Number }).ToList(); return(View(model)); }
// GET: ReservationType public ActionResult Index() { var reservationTypes = _repo.GetAll(); return(View(reservationTypes)); }