예제 #1
0
 public MenuItemBLL(MenuItem menuItemDAL)
 {
     MenuItemID = menuItemDAL.MenuItemID;
     RestaurantID = menuItemDAL.RestaurantID;
     Name = menuItemDAL.Name;
     Description = menuItemDAL.Description;
     Price = menuItemDAL.Price;
     ImgUrl = menuItemDAL.ImgUrl;
 }
예제 #2
0
        public void AddMenuItem(int restaurantID, String name, String description, Decimal price)
        {
            MenuItem menuItem = new MenuItem();
            menuItem.Name = name;
            menuItem.Description = description;
            menuItem.Price = price;
            menuItem.RestaurantID = restaurantID;

            _context.MenuItems.Add(menuItem);
            _context.SaveChanges();
        }