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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.