public void addtomenu(System.Guid itemid, System.Guid menuid) { MenuItem item = new MenuItem(); item.ItemId = itemid; item.MenuId = menuid; entities.MenuItems.AddObject(item); }
public ActionResult AddItems(System.Guid menuId, System.Guid itemId) { MenuItem menuitem = new MenuItem(); menuitem.MenuId = menuId; menuitem.ItemId = itemId; menuitem.MenuItemId = System.Guid.NewGuid(); //if (menuitemsRepository.GetMenuItem(itemId).Equals(null)) //{ if (TryUpdateModel(menuitem)) { menuitemsRepository.add(menuitem); menuitemsRepository.save(); return RedirectToAction("index"); } //} return RedirectToAction("Index"); }
/// <summary> /// Deprecated Method for adding a new object to the MenuItems EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToMenuItems(MenuItem menuItem) { base.AddObject("MenuItems", menuItem); }
/// <summary> /// Create a new MenuItem object. /// </summary> /// <param name="menuId">Initial value of the MenuId property.</param> /// <param name="itemId">Initial value of the ItemId property.</param> /// <param name="menuItemId">Initial value of the MenuItemId property.</param> public static MenuItem CreateMenuItem(global::System.Guid menuId, global::System.Guid itemId, global::System.Guid menuItemId) { MenuItem menuItem = new MenuItem(); menuItem.MenuId = menuId; menuItem.ItemId = itemId; menuItem.MenuItemId = menuItemId; return menuItem; }
public void delete(MenuItem item) { entities.MenuItems.DeleteObject(item); }
public void add(MenuItem item) { entities.MenuItems.AddObject(item); }