Example #1
0
        public IActionResult Create(Restaurant restaurant)
        {
            if (ModelState.IsValid)
            {
                _restRepo.AddRestaurant(restaurant);
                _restRepo.SaveChanges();
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["MenuId"] = new SelectList(_menuRepo.AllMenus, "Id", "Id");

            return(View(restaurant));
        }