Пример #1
0
        public void SaveInventory(IDataInventory inventory, IDataProduct product, IDataStore store)
        {
            using DbRestaurantContext context = new DbRestaurantContext();
            var I_Inventory = new Inventorys();

            // add BusinessLogic Inventory to DbInventory
            I_Inventory.ProductId = product.ProductId;
            I_Inventory.StoreId   = store.StoreId;

            I_Inventory.Quantity = inventory.Quantity;


            context.Add(I_Inventory);
            context.SaveChanges();
        }
Пример #2
0
 public HomeController(IDataInventory dataInventory)
 {
     // Implemeted Dependency Injection
     _dataInventory = dataInventory;
 }