LINQ to Entities Introduction

In Listing 19-1, we used LINQ to Entities to query the record whose CustomerID field is “LAZYK” from the Northwind database’s Customers table and to return a Customer object representing that record. We then updated the Customer object’s ContactName property and saved the change to the database by calling the SaveChanges method. Press Ctrl+F5 to run Listing 19-1. There is no console output, but if you check the database, you should see that the ContactName for customer LAZYK is now “Ned Plimpton”.