Chapter 12. Exploring EDM metadata


This chapter covers
  • Reading the EDM
  • Retrieving entity structures
  • Retrieving function structures
  • Writing generic code


Roughly speaking, the EDM consists of three XML files carrying information about classes, database, and their mappings. It’s no surprise that Entity Framework is the first consumer of these XML files, using them to generate the SQL code for CRUD operations, to understand whether a column is an identity on the database, and much more.

Reading XML files with LINQ to XML is easier than ever, but it will never be like having a set of well-designed APIs that access the same data. Entity Framework’s regular need to access EDM metadata led to the need for simplicity, which in turn led to a set ...

Get Entity Framework 4 in Action now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.