WHAT'S IN THIS CHAPTER?
The ADO.NET Entity Framework
Mapping between database tables and entity classes
Creating entity classes and their features
LINQ to Entities
The ADO.NET Entity Framework is an object-relational mapping framework that offers an abstraction of ADO.NET to get an object model based on the referential databases. This chapter gives information on the mappings between the database and the entity classes using the Conceptual Schema Definition Language (CSDL), Storage Schema Definition Language (SSDL), and the Mapping Schema Language (MSL). Different relationships between entities are covered, such as one Table-per-Hierarchy of objects, one Table-per-Type, and n-to-n relationships.
This chapter also describes different ways to access the database from the code directly with the Entity Client, using Entity SQL or helper methods that create Entity SQL, and using LINQ to Entities. Object tracking and how the data context holds change information for updating data is also shown.
This chapter uses the Books, Formula1, and Northwind databases. You can download the Northwind database from
msdn.microsoft.com; the Books and Formula1 databases are included with the download of the code samples at
The ADO.NET Entity Framework provides a mapping from the relational database schema to objects. Relational databases and object-oriented languages ...