O'Reilly logo

Professional C# 4 and .NET 4 by Morgan Skinner, Karli Watson, Jay Glynn, Bill Evjen, Christian Nagel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 31. ADO.NET Entity Framework

WHAT'S IN THIS CHAPTER?

  • The ADO.NET Entity Framework

  • Mapping between database tables and entity classes

  • Creating entity classes and their features

  • Object contexts

  • Relationships

  • Object queries

  • Updates

  • 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.

Note

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 http://www.wrox.com.

OVERVIEW OF THE ADO.NET ENTITY FRAMEWORK

The ADO.NET Entity Framework provides a mapping from the relational database schema to objects. Relational databases and object-oriented languages ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required