public MenuItemRepository()
 {
     Context = new FoodMenuContext();
 }
 public static void AddMenuItem(FoodMenuContext Context, MenuItem MenuItem)
 {
     Context.MenuItems.Add(MenuItem);
     Context.SaveChanges();
 }
Beispiel #3
0
 public FoodMenuRepositoryBase()
 {
     Context = new FoodMenuContext();
     DbSet   = Context.Set <TEntity>();
 }
 public static MenuHeader GetMenuHeaderById(FoodMenuContext Context, int IDHeader)
 {
     return(Context.MenuHeaders.Where(u => u.IdMenuHeader == IDHeader).FirstOrDefault());
 }
 public static void AddMenuHeader(FoodMenuContext Context, MenuHeader MenuHeader)
 {
     Context.MenuHeaders.Add(MenuHeader);
     Context.SaveChanges();
 }
Beispiel #6
0
 public static Restaurant GetRestaurantById(FoodMenuContext Context, int id)
 {
     return(Context.Restaurants.Include(u => u.Menus).Where(u => u.IdRestaurant == id).FirstOrDefault());
 }
Beispiel #7
0
 public RestaurantRepository()
 {
     Context = new FoodMenuContext();
 }