Esempio n. 1
0
        public void UpdateCustomerOrderLineItem(CustomerOrderLineItem customerOrderLineItem2BUpated)
        {
            Entity.CustomerOrderLineItem oldCustomerOrderLineItem = _context.CustomerOrderLineItems.Find(customerOrderLineItem2BUpated.Id);
            _context.Entry(oldCustomerOrderLineItem).CurrentValues.SetValues(_mapper.ParseCustomerOrderLineItem(customerOrderLineItem2BUpated));

            _context.SaveChanges();
            _context.ChangeTracker.Clear();
        }
 public Model.CustomerOrderLineItem ParseCustomerOrderLineItem(Entity.CustomerOrderLineItem customerOrderLineItem)
 {
     return(new Model.CustomerOrderLineItem
     {
         OrderId = customerOrderLineItem.OrderId,
         ProdId = customerOrderLineItem.ProdId,
         Quantity = customerOrderLineItem.Quantity,
         ProdPrice = customerOrderLineItem.ProdPrice,
         Id = customerOrderLineItem.Id
     });
 }