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

Working with the ADO.NET Data Service Client Library


ADO.NET Data Services includes a powerful client library that provides a programming model that you can use to perform CRUD operations in your applications. To use the ADO.NET Client Library, you need to include the System.Data.Services.Client namespace in your program. Note that the ADO.NET Client Library is accessible from any client application including Windows Forms, Web Forms, WPF, etc. The two major classes included in this library are the DataServiceContext class and the DataServiceQuery class. While the former represents the runtime context of the data service, the latter represents the query against the store.

To start using the ADO.NET Data Service Client, ensure that you add a reference to the System.Data.Services.Client assembly to your project. See this in the following figure:

Generating the Client-Side Entity Classes

To generate the client-side entity classes, follow these steps:

  1. 1. Open a command window and switch to the...