Updating customer details
Let's go ahead and add some code to allow for updating customer details by following these steps:
- Update
ICustomerService
to add the operation shown in the following code:[OperationContract] void Update(Customer customer);
- Update
CustomerService
to implement the new operation as shown in the following code:public void Update(Customer customer) { Data.Customer customerEntity = _northwindEntities .Customers.Single( c => c.CustomerID == customer.CustomerID); customerEntity.CompanyName = customer.CompanyName; customerEntity.ContactName = customer.ContactName; customerEntity.Address = customer.Address; customerEntity.City = customer.City; customerEntity.Country = customer.Country; customerEntity.Region = customer.Region; customerEntity.PostalCode ...
Get MVVM Survival Guide for Enterprise Architectures in Silverlight and WPF now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.