DCSIMG
Entity Data Model (EDM) In Entity Framework - Gil Fink's Blog

Gil Fink's Blog

Fink about IT

News

Microsoft MVP

My Facebook Profile My Twitter Profile My Linkedin Profile

Locations of visitors to this page

Creative Commons License

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.
© Copyright 2013 Gil Fink

Hebrew Articles

Index Pages

My OSS Projects

English Articles

Entity Data Model (EDM) In Entity Framework

Entity Data Model (EDM) In Entity Framework

In the last post about entity framework I wrote an introduction about the framework.
Today I'm going to dive into the heart of the framework - the entity data model (EDM).

What is the Entity Data Model (EDM)?
The EDM is a specification for defining the data used by applications built on the
entity framework.

Entity data model (EDM) desgin:

Entity Data Model

EDM Layers
There are three layers in the EDM:

  • Conceptual layer
  • Mapping layer
  • Logical layer

The layers help to bridge the gap between the relational database schema and
the wanted entities in the application.
Every layer is represented in a XML schema.
The conceptual layer is defined by a Conceptual Schema Definition Language
(CSDL). The CSDL defines the entities and the relations between the entities
as expected from the business logic of the application.
The mapping layer is defined by a Mapping Schema Language (MSL).
The MSL defines the mapping between the conceptual layer and the logical layer.
The logical layer is defined by a Store Schema Definition Language (SSDL).
The SSDL is a representation of the relational database or part of it.

Mapping Example
Lets generate a one to one mapping between a database and a business logic
object model.
From the Add New Item menu, choose the ADO.NET Entity Data Model and
add it to your project:
Add new EDM
The result of choosing to add the EDM is a wizard that help you to build the EDM.
First, choose the model content. It can be generated from a database or from an
empty model:
Choose Model Content 
Then, choose your data connection in the same way you choose data connections
(by using a connection string or generating a new one):
Choose Data Connection 
A screen with the database tables, views and stored procedures will be open.
You can either choose everything or choose the relevant objects for the module
you build.
Choose Database Objects
Choose Database Tables
In a one to one mapping you will choose everything and therefore click the
Finish button to generate the EDM file in the project.
The result:
EDM Designer 
You can use the model browser view to look at the generated entities, tables and
mapping.
In the next post I'm going to demonstrate the XML files types and how they are
represented.

Comments

Gil Fink Blog said:

On the previous post about the entity framework I wrote about the entity data model (EDM) and explained

# April 26, 2008 11:24 AM

Gil Fink's Blog said:

In this post I show the entity data model (EDM) designer and some of its features.

# May 17, 2008 10:02 PM

Gil Fink's Blog said:

In this post I describe the new EDM schema types - SSDL, MSL and the CSDL. Also, I explain some key elements of the schema definition language.

# May 18, 2008 10:50 AM

ADO.NET Entity Framework Tutorials - Gil Fink on .Net said:

Pingback from  ADO.NET Entity Framework Tutorials - Gil Fink on .Net

# March 2, 2010 9:42 AM

Create An Effective Data Model For Your Database said:

Pingback from  Create An Effective Data Model For Your Database

# January 30, 2012 11:56 AM