public BusinessLogic.ProductInventory GetProductInventoryById(int id) { Entities.ProductInventory entity = _context.ProductInventory .Include(p => p.Product).First(pi => pi.Id == id); return(Mapper.MapProductInventory(entity)); }
/// <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, }); }
public void UpdateProductInventory(BusinessLogic.ProductInventory productInventory) { Entities.ProductInventory pi = Mapper.MapProductInventory(productInventory); _context.Update(pi); }