예제 #1
0
 public void UpdateCustomer(Customer customer2BUpdated)
 {
     Entity.Customer oldCustomer = _context.Customers.Find(customer2BUpdated.CustID);
     _context.Entry(oldCustomer).CurrentValues.SetValues(_mapper.ParseCustomer(customer2BUpdated));
     _context.SaveChanges();
     _context.ChangeTracker.Clear();
 }
예제 #2
0
 public void UpdateInventory(Item item, int quantity)
 {
     Entity.Inventory oldItem = _context.Inventories.Find(item.Id);
     _context.Entry(oldItem).CurrentValues.SetValues(
         oldItem.Quantity = quantity
         );
     _context.SaveChanges();
     _context.ChangeTracker.Clear();
 }