EDMX file.

database
Database @Image courtesy of ddpavumba/ FreeDigitalPhotos.net

EDMX file.

Welcome to CodeSpread!

Few lines about Entity Framework

The Entity Framework is an object-relational mapping framework or O/RM.For more info on O/RM refer Magic Wand: Object-relational mapping. It was released with .NET 3.5 SP1.

What we achieve with EF is the separation between the representation details like a conceptual model from the implementation details like a relational data store. EF uses mapping details to bridge the conceptual model to its data storage model. We can have a sense of independence during implementation provided by the isolation between models and layers.In this way, we can create a model of entities that hold data in an object-oriented way. This isolation helps us to model the data store in an abstract way and target potentially any data store.

Architecture

ref: wikipedia

What is EDMX?

EDMX is an extended version of the Entity-Relationship model where Entity data model specifies the conceptual model of the data. EDMX file can be seen as a container of Entity Data Model.

An .edmx file is an XML file that defines a model that can be used with Entity Framework. The model is made up of a conceptual model, a storage model, and the mapping between these models.

By default, an .edmx file opens with the EF Designer and it is also the recommended practice for creating and editing an .edmx file.

Steps to add edmx file.

  • Open or create the project.
  • Right-click on the project name and select Add-> New Item .
  • Select ADO.NET Entity Data Model template.image
  • Entity Data Model Wizard starts.

image

  • Either Select ‘Empty Model’ or ‘Generate from Database’ and click Finish

image

Wizard Over.

.edmx file encapsulates the storage model, the conceptual model, and mappings.

Few Terminologies

Conceptual Model: This model is an abstract representation for the entity types, complex types, associations, entity containers, entity sets, and association sets mapped to a relational data store. The conceptual model is defined in CSDL in the .csdl file.

Storage model: This can be defined as a relational database represented as a abstraction in conceptual model. The storage model is defined in SSDL in the .ssdl file.

Mapping : This represents a bridge between conceptual model and storage model.

Eager loading: Loading related objects along with the object requested in the query.

Explicit loading: Delay in loading related objects along with the object requested in the query till they are requested using the ‘Load’ method on a navigation property.

Lazy loading: Delay in loading related objects along with the object requested in the query till their navigation property is accessed.

Author: hershey

A passion for knowledge drives me to do programming, A passion for programming drives me to create something different, A passion for creation drives me to spread the knowledge.

Share This Post On

0 Comments

  1. nice superb explaination

    Post a Reply
  2. thanks for the tutorial
    I am having a problem.
    The feature “Create SQL server database” isn’t available , I can’t select it.
    Can you help, please ?

    Post a Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

More from CodeSpread:

  • POCO vs Custom Classes/DTOPOCO vs Custom Classes/DTOWhen I started working on Entity Framework, I didn't catch the idea of POCO initially. I started with custom classes and later came to know the advantages of POCO over custom classes. What is POCO...
  • Try one ORM: Entity FrameworkTry one ORM: Entity FrameworkAs promised in the last article, We are going to share our experience of Entity Framework Ver 4.1. First of all, we have to add and configure Entity Framework in visual studio. We are going to u...
  • Agile Encounters UnpredictabilityAgile Encounters UnpredictabilityWhat is Agile? Wikipedia says “Agile software development is a group of software development methods based on iterative and incremental development, where requirements and solutions evolve through...
  • Best Practices: Does Professional Database exists?Best Practices: Does Professional Database exists?What is Database? Database is a structured set of data, which facilitates storage,search and retrieval. Databases revolves around tables and relationships between them. Imagine you have a truck lo...
  • Magic Wand: Object-relational mappingMagic Wand: Object-relational mappingAs a developer, we are always looking for reusable components which can ease our life and I can suggest ORM as the developer's magic wand because it wipes off the overhead of dealing directly with ...
  • Software Testing Life Cycle (STLC)Software Testing Life Cycle (STLC)Software Testing Life Cycle (STLC) is a process which consists of a number of phases to improve the quality of the product. Each phase involves various testing activities like Requirement An...
  • C# Code to send a MailC# Code to send a MailWhile working in a project, we always neglect the importance of the code which we have written many times and now end up in copy pasting the code from old projects. Lately, I saw a request in fo...
  • Freeze Business Logic Layer.Freeze Business Logic Layer.We regularly work on three-layer architecture for application development and always use some standard data layer and UI layer guidelines for design but what we always ignore is business logic laye...