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 theentity framework.Entity data model (EDM) desgin:
EDM LayersThere are three layers in the EDM:
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 entitiesas 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 ExampleLets generate a one to one mapping between a database and a business logicobject model.From the Add New Item menu, choose the ADO.NET Entity Data Model andadd it to your project: 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 anempty model: Then, choose your data connection in the same way you choose data connections (by using a connection string or generating a new one): 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 moduleyou build. In a one to one mapping you will choose everything and therefore click theFinish button to generate the EDM file in the project.The result: 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 arerepresented.
On the previous post about the entity framework I wrote about the entity data model (EDM) and explained
In this post I show the entity data model (EDM) designer and some of its features.
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.
Pingback from ADO.NET Entity Framework Tutorials - Gil Fink on .Net
Pingback from Create An Effective Data Model For Your Database