コード例 #1
0
        public IActionResult ManageSingleMenu(string menuName)
        {
            var menu  = menuRepository.GetFullMenuByName(menuName);
            var model = new ManageSingleMenuViewModel
            {
                Menu = menu
            };

            return(View("ManageSingleMenu", model));
        }
コード例 #2
0
        public IActionResult AddFoodCategory(ManageSingleMenuViewModel model)
        {
            if (model.Menu.Categories == null)
            {
                model.Menu = menuRepository.GetFullMenuByName(model.Menu.MenuName);
            }
            var id = menuRepository.CreateNewFoodCategory(model.CategoryNameToAdd, model.Menu);

            return(RedirectToAction(nameof(ManageFoodCategory), new { foodCategoryId = id }));
        }