コード例 #1
0
        public BusinessLogic.ProductInventory GetProductInventoryById(int id)
        {
            Entities.ProductInventory entity = _context.ProductInventory
                                               .Include(p => p.Product).First(pi => pi.Id == id);

            return(Mapper.MapProductInventory(entity));
        }
コード例 #2
0
 /// <summary>
 /// converts a production entery into a production object
 /// </summary>
 /// <param name="product">production entery to be converted</param>
 /// <returns>production object</returns>
 public static BusinessLogic.ProductInventory MapProductInventory(Entities.ProductInventory productInventory)
 {
     return(new BusinessLogic.ProductInventory
     {
         Id = productInventory.Id,
         LocationId = productInventory.LocationId,
         Product = MapProduct(productInventory.Product),
         Quantity = productInventory.Quantity,
     });
 }
コード例 #3
0
        public void UpdateProductInventory(BusinessLogic.ProductInventory productInventory)
        {
            Entities.ProductInventory pi = Mapper.MapProductInventory(productInventory);

            _context.Update(pi);
        }