Book Image

WCF Multi-layer Services Development with Entity Framework - Fourth Edition

By : Mike Liu
Book Image

WCF Multi-layer Services Development with Entity Framework - Fourth Edition

By: Mike Liu

Overview of this book

Table of Contents (20 chapters)
WCF Multi-layer Services Development with Entity Framework Fourth Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
2
Hosting the HelloWorld WCF Service
Index

Creating the data model


To use LINQ to Entities, we need to add a conceptual data model, EDM, to the project. There are two ways to create an EDM: create it from a database or create it manually. Here, we will create the EDM from the Northwind database. We will add two tables and one view from the Northwind database into our project, so that later on we can use them to demonstrate LINQ to Entities.

Installing Entity Framework

To utilize LINQ to Entities, we first need to install Entity Framework to the project. Follow these steps to do this:

  1. From the Solution Explorer, right-click on the project item and then select Manage NuGet Packages.....

  2. On the Manage NuGet Packages window, select Online | nuget.org | EntityFramework.

  3. Click on the Install button to install Entity Framework to the project. This will add three references to the project, change the config file to include nodes for Entity Framework, add a folder called packages for the Entity Framework package, and add a packages.config file...