Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
WCF Multi-layer Services Development with Entity Framework - Fourth Edition

You're reading from   WCF Multi-layer Services Development with Entity Framework - Fourth Edition Create and deploy complete solutions with WCF and Entity Framework

Arrow left icon
Product type Paperback
Published in Oct 2014
Publisher
ISBN-13 9781784391041
Length 378 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Mike Liu Mike Liu
Author Profile Icon Mike Liu
Mike Liu
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Implementing a Basic HelloWorld WCF Service FREE CHAPTER 2. Hosting the HelloWorld WCF Service 3. Deploying the HelloWorld WCF Service 4. Debugging the HelloWorld WCF Service 5. Implementing a Three-layer WCF Service 6. Adding Database Support and Exception Handling 7. LINQ to Entities – Basic Concepts and Features 8. LINQ to Entities – Advanced Concepts and Features 9. Applying LINQ to Entities to a WCF Service 10. Distributed Transaction Support of WCF 11. Building a RESTful WCF Service 12. WCF Security 13. Extending WCF Services Index

Adding a data access layer


We have two layers, the service interface layer and the business logic layer, in our solution now. We don't have any code to interact with a data store to manipulate the underlying data. As said in the previous chapter, such code should be separated from these two layers, so now we will add one more layer, the data access layer, for this purpose. Within this third layer, we will query a real database to get the product information and update the database for a given product.

Creating the data access layer project

First, we will create the project for the data access layer. As we did for the business logic layer, what we need to do is add a C# class library project named LayerNorthwindDAL (where DAL stands for Data Access Layer) to the solution. Then, we need to change the default class file to be our Data Access Object (DAO) file.

Now, modify the Class1.cs file as follows:

  1. Rename it to ProductDAO.cs. This will also rename the class name and all related places in the...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image