async Task <Customer> ICustomerRepository.UpdateAsync(Customer customer) { var current = await _db.Customer.FirstOrDefaultAsync(_customer => _customer.Id == customer.Id); if (current != null) { _db.Entry(current).CurrentValues.SetValues(customer); } await _db.SaveChangesAsync(); return(customer); }
async Task <Order> IOrderRepository.UpdateAsync(Order order) { var current = await _db.Order.FirstOrDefaultAsync(_order => _order.Id == order.Id); if (current != null) { _db.Entry(current).CurrentValues.SetValues(order); } await _db.SaveChangesAsync(); return(order); }
async public Task <Product> UpdateAsync(Product product) { var current = await _db.Product.FirstOrDefaultAsync(_product => _product.Id == product.Id); if (current != null) { _db.Entry(current).CurrentValues.SetValues(product); } await _db.SaveChangesAsync(); return(product); }