public IActionResult ManageSingleMenu(string menuName) { var menu = menuRepository.GetFullMenuByName(menuName); var model = new ManageSingleMenuViewModel { Menu = menu }; return(View("ManageSingleMenu", model)); }
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 })); }