Book Image

Entity Framework Tutorial

By : Joydip Kanjilal
Book Image

Entity Framework Tutorial

By: Joydip Kanjilal

Overview of this book

<p>The ADO.NET Entity Framework is a new way to build the data access layer of your Windows or web applications. It's an Object Relational Mapping (ORM) technology that makes it easy to tie together the data in your database with the objects in your applications, by abstracting the object model of an application from its relational or logical model.<br /><br />This clear and concise book gets you started with the Entity Framework and carefully gives you the skills to speed up your application development by constructing a better data access layer. It shows you how to get the most from the ADO.NET Entity Framework to perform CRUD operations with complex data in your applications.<br /><br />This tutorial starts out with the basics of the Entity Framework, showing plenty of examples to get you started using it in your own code. You will learn how to create an Entity Data Model, and then take this further with Entity types. You will also learn about the Entity Client data provider, learn how to create statements in Entity SQL, and get to grips with ADO.NET Data Services, also known as Project Astoria.</p>
Table of Contents (13 chapters)
Entity Framework Tutorial
Credits
About the Author
About the Reviewer
Preface

Installing the Prerequisites


To run the programs given in this book, you should have the following elements installed on your system:

  • Visual Studio.NET 2008 Professional

  • SQL Server 2005 or higher

  • Microsoft .NET Framework 3.5 SP1

  • ADO.NET Entity Framework Beta 3 or higher

  • ADO.NET Entity Framework Tools December 2007 CTP or higher

Installing the ADO.NET Entity Framework and Its Tools

Before you proceed with installing EF Beta 3 and its tools, make sure that you have installed Visual Studio.NET 2008 Professional and SQL Server 2005 on your system. I will skip the discussion on installing Visual Studio 2008 Professional and SQL Server 2005 at this time.

Downloading the Software

Let us take a look at the necessary software that you need to download in order to work with the ADO.NET Entity Framework.

Installing the Software

Now that the required software has been downloaded, we will now install each one individually.

Double-click on the ADO.NET Entity Framework Setup file. The following installation wizard window will appear:

Now, click on Next.

Here is how the next screen looks like:

In the above window that appears, check the checkbox and click on Install.

The installation procedure starts and when done, the following screen appears:

Click on Finish to complete the installation process.

Now that you have installed the ADO.NET Entity Framework successfully on your system, the next step is to install the ADO.NET Entity Framework Tools CTP. But before you do that, you need to install the Visual Studio.NET 2008 patch update.

Double-click on the Visual Studio.NET patch update setup file that you downloaded earlier. The following window appears:

Now, click on Next.

The following window appears:

Check the check box to agree and accept the license terms and click on Next to start the installation process.

Once the installation is complete, the following window appears:

Click on Finish to complete the installation process.

Now, we need to install the ADO.NET Entity Framework Tools CTP. To do this, double-click on the ADO.NET Entity Framework December 2007 Tools CTP you downloaded earlier. The following screen appears:

Click on Next. The following window appears:

Now, check the check box to accept the license terms and click on Next. The following window will appear:

Click on Install to start the installation process. Once the installation is complete, the following window is displayed:

Clink on Finish to complete the installation process.

We will now install Microsoft .NET Framework 3.5 SP1. It contains many additional features and most importantly, we need it to work with the Entity Data Source control. We will discuss this control in the next chapter.

To install Microsoft .NET Framework 3.5 SP1 on your system, double-click on the setup file you downloaded earlier. The following screenshot shows the window that will appear:

Select the radio button to accept the terms of the license agreement and click on Install to start the installation process.

Once the installation process is complete, the following window is displayed:

Click on Exit to complete the installation process. You are done!

Having installed these prerequisites, we will now design our sample database. We will use this database throughout this book. We will assign the name Payroll to our design database. The next section discusses the design of this sample database.