Free Web Development Online Tutorials, Learn to Code
Learn Entity Framework with C#, Entity Framework Core, Code First, DB First Approach

Edmx in Entity Framework C#

What is .EDMX file in Entity Framework? EDMX stands for Entity Data Model XML

Add Edmx in Entity Framework

Let's add a edmx file in your project. just right click on your .net project and add an "Ado.Net Entity Data Model" file as shown below. the file extension would be .edmx

entity framework tutorial
Fetching database objects in EDMX file

While adding a edmx file in your project, either you can generate model from database, or you can create empty model.

model in edmx
EDMX Structure

Now let's look at how edmx file look like, simply expand each node under edmx file you just created in solution

edmx model creation

CSDL, SSDL, and MSL files in Entity Framework

Earlier during database connection setup we have talked about CSDL, SSDL, MSL, but here in this solution you are not seeing them, so probably you have a question where are those files.

CSDL, SSDL, MSL files are generated at build time, so once you compile (Control + shift + B) the application those files will be generated in bin folder, during build it takes Meta information from edmx file, Then during run time assembly uses that information from embedded resources.

But here are the steps to see those files, open your solution and just click on

“Show all files”, then expand “Obj” => “Debug” => “edmxResourcesToEmbed”.

CSDL, SSDL, and MSL files in Entity Framework

CSDL, MSL, SSDL are all embedded resources in Entity Framework edmx file

Comment
Name
Email
Website
Subscribe
 
Edmx file example