Ejemplo n.º 1
0
        public void UpdateCustomerOrderHistory(CustomerOrderHistory customerOrderHistory2BUpated)
        {
            Entity.CustomerOrderHistory oldCustomerOrderHistory = _context.CustomerOrderHistories.Find(customerOrderHistory2BUpated.Id);
            _context.Entry(oldCustomerOrderHistory).CurrentValues.SetValues(_mapper.ParseCustomerOrderHistory(customerOrderHistory2BUpated));

            _context.SaveChanges();
            _context.ChangeTracker.Clear();
        }
 public Model.CustomerOrderHistory ParseCustomerOrderHistory(Entity.CustomerOrderHistory customerOrderHistory)
 {
     return(new Model.CustomerOrderHistory
     {
         LocId = customerOrderHistory.LocId,
         CustId = customerOrderHistory.CustId,
         OrderDate = customerOrderHistory.OrderDate,
         OrderId = customerOrderHistory.OrderId,
         Total = customerOrderHistory.Total,
         Id = customerOrderHistory.Id
     });
 }