public Restaurant Edit(Restaurant Restaurant) { Restaurant OldRestaurant = Context.Restaurants.Where(u => u.IdRestaurant == Restaurant.IdRestaurant).FirstOrDefault(); OldRestaurant.NamRestaurant = Restaurant.NamRestaurant; OldRestaurant.Menus = Restaurant.Menus; OldRestaurant.DesRestaurant = Restaurant.DesRestaurant; OldRestaurant.CNPJ = Restaurant.CNPJ; OldRestaurant.CEP = Restaurant.CEP; OldRestaurant.AddressComplement = Restaurant.AddressComplement; OldRestaurant.Address = Restaurant.Address; Context.SaveChanges(); return(Restaurant); }
public static void AddMenuItem(FoodMenuContext Context, MenuItem MenuItem) { Context.MenuItems.Add(MenuItem); Context.SaveChanges(); }
public virtual void Save() { Context.SaveChanges(); }
public void CreateMenu(Menu Menu) { Context.Menus.Add(Menu); Context.SaveChanges(); }
public static void AddMenuHeader(FoodMenuContext Context, MenuHeader MenuHeader) { Context.MenuHeaders.Add(MenuHeader); Context.SaveChanges(); }