public RedirectToActionResult AddToCart(int dishId) { Dish dish = service.GetDish(dishId).Result; if (dish != null) { cart.AddToCart(dish); } return(RedirectToAction("Index")); }
public async Task <IActionResult> GetDish(int?id) { if (id != null) { Dish dish = await kitchen.GetDish(id); if (dish != null) { return(View(dish)); } } return(NotFound()); }