Modeling the Northwind database
In the previous section, we created the LINQNorthwind
solution. Next, we will apply LINQ to Entities to this new solution.
For the data access layer, we will use LINQ to Entities instead of the raw ADO.NET data adapters. As you will see in the next section, we will use one LINQ statement to retrieve product information from the database, and the update LINQ statements will handle the concurrency control for us easily and reliably.
As you might recall, to use LINQ to Entities in the data access layer of our WCF service, we first need to add an entity data model to the project. The following steps are very similar to those described in Chapter 8, LINQ to Entities – Advanced Concepts and Features. You can refer to that chapter for more information and screenshots if necessary.
In the Solution Explorer, right-click on the project item, NorthwindDAL, select menu options Add | New Item…, and then choose Visual C# Items | ADO.NET Entity Data Model as Template and enter...