Пример #1
0
        public IActionResult RestaurantTypeEdit(int id)
        {
            RestaurantType typeFromDb      = _service.Get(id);
            RestaurantTypeEditViewModel vm = new RestaurantTypeEditViewModel()
            {
                Naam = typeFromDb.Naam
            };

            return(View(vm));
        }
Пример #2
0
        public IActionResult RestaurantCreate()
        {
            List <SelectListItem>        typesList = new List <SelectListItem>();
            IEnumerable <RestaurantType> types     = _restaurantTypeService.Get();

            foreach (var type in types)
            {
                typesList.Add(new SelectListItem {
                    Value = type.Id.ToString(), Text = type.Naam
                });
            }
            RestaurantCreateViewModel vm = new RestaurantCreateViewModel
            {
                TypeList = typesList
            };

            return(View(vm));
        }