예제 #1
0
        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);
        }
예제 #2
0
 public static void AddMenuItem(FoodMenuContext Context, MenuItem MenuItem)
 {
     Context.MenuItems.Add(MenuItem);
     Context.SaveChanges();
 }
예제 #3
0
 public virtual void Save()
 {
     Context.SaveChanges();
 }
예제 #4
0
 public void CreateMenu(Menu Menu)
 {
     Context.Menus.Add(Menu);
     Context.SaveChanges();
 }
예제 #5
0
 public static void AddMenuHeader(FoodMenuContext Context, MenuHeader MenuHeader)
 {
     Context.MenuHeaders.Add(MenuHeader);
     Context.SaveChanges();
 }