Using LINQ to Entities in the data access layer
Next, we will modify the data access layer to use LINQ to Entities to retrieve and update products. We will first create GetProduct
to retrieve a product from the database and then create UpdateProduct
to update a product in the database.
Adding a reference to the BDO project
Now that we have the BDO project in the solution, we need to modify the data access layer project to reference it.
- In the Solution Explorer, right-click on the NorthwindDAL project.
- Select Add | Reference....
- Select the NorthwindBDO project from the Projects tab under Solution.
- Click on the OK button to add the reference to the project.
Creating GetProduct in the data access layer
We can now create the GetProduct
method in the data ...
Get WCF Multi-layer Services Development with Entity Framework Fourth Edition 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.