Chapter 2. Exploring the Entity Data Model

The Entity Data Model (EDM) is the bridge between your application and your data store. It allows you to work with a conceptual view of your data rather than the actual database schema. .NET APIs provided by the Entity Framework use the EDM for every interaction with the data store, whether it is to retrieve or to save data. The Entity Framework tools generate classes from the model that enable you to work with objects described by the model.

In this chapter, you will create a simple EDM using the ADO.NET Entity Data Model Wizard, and then you will inspect the model both in the Designer and by looking at its raw XML. This chapter will stick to the basics of the model so that you can become familiar with how an EDM is structured and how the most common elements relate to one another, to your code, and to the database. This chapter contains a lot of information, but because the Entity Framework is built around the EDM, you’ll appreciate having a solid understanding of the model as you work your way through this book.

Chapter 12 will explore the more complex aspects of the EDM, such as its different inheritance capabilities and how to customize models so that they can better reflect your business logic.

Why Use an Entity Data Model?

Well-designed databases can pose a problem for developers.

In the data world, a database is designed for maintainability, security, efficiency, and scalability. Its data is organized in a way that satisfies the demands ...

Get Programming Entity Framework 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.