Ejemplo n.º 1
0
 public void UpdateCustomer(Lib.Customer customer)
 {
     //_db.Entry(customer).State = EntityState.Modified;
     // calling Update would mark every property as Modified.
     // this way will only mark the changed properties as Modified.
     _db.Entry(_db.Customer.Find(customer.Id)).CurrentValues.SetValues(Mapper.Map(customer));
 }
Ejemplo n.º 2
0
 public void UpdateOrder(Order order)
 {
     _db.Entry(_db.StoreOrder.Find(order.OrderId)).CurrentValues.SetValues(Mapper.Map(order));
 }