Exemplo n.º 1
0
        public static Business.Library.Inventory MapInv(Entities.Inventory inventory)
        {
            Product p = MapProduct(inventory.Product);

            return(new Business.Library.Inventory
            {
                ID = inventory.Id,
                location_id = inventory.LocationId,
                product_id = inventory.ProductId,
                quantity = inventory.Quantity,
                Product = p,
                Location = MapLocation(inventory.Location)
            });
        }
 public void UpdateLocationInventory(Business.Library.Inventory inventory)
 {
     Entities.Inventory myEntity  = _context.Inventory.Find(inventory.ID);
     Entities.Inventory newEntity = Mapper.MapInv(inventory);
     _context.Entry(myEntity).CurrentValues.SetValues(newEntity);
 }