Updating customer details

Let's go ahead and add some code to allow for updating customer details by following these steps:

  1. Update ICustomerService to add the operation shown in the following code:
    [OperationContract]
    void Update(Customer customer);
    
  2. 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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.