/// <summary> /// Method that converts DB inventory to Business Logic inventory and vice versa /// </summary> /// <param name="i"></param> /// <returns></returns> public BusinessLogic.Inventory ParseInventory(Entities.Inventory i) { return(new BusinessLogic.Inventory() { Prod = ParseProduct(_context.Product.Single(p => p.ProductId == i.ProductId)), Stock = i.Stock, InventID = i.InventoryId }); }
/// <summary> /// Method that gets a product id /// </summary> /// <param name="inventID"></param> /// <returns></returns> private int GetProductId(int inventID) { Entities.Inventory i = _context.Inventory.Single(inv => inventID == inv.InventoryId); return(i.ProductId); }