public Order AddMenuToOrder(Order order, Menu menu) { var ctxOrder = context.Orders.Find(order.Id); ctxOrder.Menus.Add(menu); context.SaveChanges(); return ctxOrder; }
public ActionResult Create(Order order) { if (ModelState.IsValid) { orderRepository.InsertOrUpdate(order); orderRepository.Save(); return RedirectToAction("Index"); } else { ViewBag.PossibleWaiters = waiterRepository.All; ViewBag.PossibleRestaurants = restaurantRepository.All; return View(); } }