Database Reference
In-Depth Information
C H A P T E R 19
Using the ADO.NET Entity
Framework
Many database developers thought that database APIs were mature enough with the release of ADO.NET
2.0 and LINQ, but these data access APIs continued to evolve. Data access APIs are reasonably
straightforward to use, and they let you simulate the same kinds of data structures and relationships that
exist in relational databases.
However, you don't interact with data in data sets or data tables in the same way you do with data in
database tables. The differences between the relational model of data and the object-oriented model of
programming are considerable, and ADO.NET 2.0 and LINQ do relatively little to reduce impedance
between the two models.
With the release of .NET Framework 4.5 and Visual Studio 2011, a new version of ADO.NET Entity
Framework 5.0 was introduced. This chapter will introduce you to the ADO.NET Entity Framework 5.0
data model, also known as the Entity Data Model (EDM).
EDM is Microsoft's way of implementing object-relational mapping (ORM). ORM is a way of
processing and mapping relational data into a collection of objects, called entities . You will learn more
about it, including the advantages of this approach, in this chapter.
In this chapter, I'll cover the following:
Understanding ADO.NET Entity Framework 5.0
Understanding the Entity Data Model
Working with the Entity Data Model
Understanding ADO.NET Entity Framework 5.0
The vision behind ADO.NET Entity Framework (EF) 5.0 is to extend the level of abstraction for database
programming and completely remove the impedance mismatch between data models and development
languages that programmers use to write database-oriented software applications.
ADO.NET EF 5.0 allows developers to focus on data through an object model instead of through the
traditional logical/relational data model, helping abstract the logical data schema into a conceptual
model, a mapping layer, and a logical layer to allow interaction with that model through a new data
provider called EntityClient .
In this chapter, I will review the purpose of each of these layers.
ADO.NET EF 5.0 allows developers to write less data access code, reduces maintenance, and
abstracts the structure of the data into a more business-friendly manner. It can also help reduce the
number of compile-time errors since it generates strongly typed classes from the conceptual model.
ADO.NET EF 5.0 generates a conceptual model that developers can write code against using a new
data provider called EntityClient , as mentioned previously. EntityClient follows a model similar to
 
Search WWH ::




Custom Search