public ActionResult Create(FormCollection collection) { Menu menu = new Menu(); MembershipUser user = Membership.GetUser(); Vendor vendor = vendorsRepository.GetVendorByUserId((Guid)user.ProviderUserKey); menu.VendorId = vendor.VendorId; menu.MenuId = System.Guid.NewGuid(); if (TryUpdateModel(menu)) { menusRepository.add(menu); menusRepository.save(); return RedirectToAction("index"); } return RedirectToAction("Index"); }
public void delete(Menu menu) { entities.Menus.DeleteObject(menu); }
/// <summary> /// Deprecated Method for adding a new object to the Menus EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToMenus(Menu menu) { base.AddObject("Menus", menu); }
public void add(Menu menu) { entities.Menus.AddObject(menu); }
/// <summary> /// Create a new Menu object. /// </summary> /// <param name="menuId">Initial value of the MenuId property.</param> /// <param name="vendorId">Initial value of the VendorId property.</param> public static Menu CreateMenu(global::System.Guid menuId, global::System.Guid vendorId) { Menu menu = new Menu(); menu.MenuId = menuId; menu.VendorId = vendorId; return menu; }