O'Reilly logo

Professional C# 5.0 and .NET 4.5.1 by Morgan Skinner, Jay Glynn, 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 33ADO.NET Entity Framework

WHAT’S IN THIS CHAPTER?

  • Programming Models
  • Mapping
  • Entity classes
  • Object contexts
  • Relationships
  • Querying data
  • Updates
  • Code First

WROX.COM CODE DOWNLOADS FOR THIS CHAPTER

The wrox.com code downloads for this chapter are found at www.wrox.com/go/procsharp on the Download Code tab. The code for this chapter is divided into the following major examples:

  • Books Demo
  • Payments Demo
  • Formula 1 Demo
  • Code First Demo
  • Code First Migrations

PROGRAMMING WITH THE ENTITY FRAMEWORK

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. You can use different programming models with the Entity Framework: Model First, Database First, and Code First. Both Model First and Database First provide mapping information with a mapping file. Using Code First, mapping information is all done via C# code. This chapter provides information about all these programming models.

You will learn about the mappings between the database and the entity classes using the Conceptual Schema Definition Language (CSDL), the 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 EntityClient provider, using Entity ...

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