Entity Framework - CSDL, SSDL, and MSL Files

I am just picky, but I studied how the Entity Framework generates a DLL from an EDMX file, and I saw this in msdn:

The Entity Designer stores the modeling and mapping information in the .edmx file during development. At build time, Entity Designer uses the information in the .edmx file to create the .csdl, .ssdl, and .msl files that are required by the Entity Framework at run time.

I really found it strange that he said that "during build" .csdl, .ssdl and .msl are created, so I decided to test. I know that files are created based on the TablePerTypeStrategy.xaml stream, so I deleted it and tried to create my application. It succeeded.

When I selected โ€œgenerate database from modelโ€, I received an error when the TablePerTypeStrategy.xaml file was missing. So I was embarrassed, clearly from this test, which is generated when I try to create a database, and not create an application.

What am I missing here?

+5
source share
2 answers

These files (.csdl, .ssdl, .msl) are generated at build time and injected as resources into the assembly for use by the Entity Framework classes at run time. Creating a database from a model is another process that generates the creation of a database script.

+4
source

*.csdl, *.ssdl, *.msl, . " " ( edmx), .

enter image description here

obj\x86\Debug\edmxResourcesToEmbed. XML , , , obj .

edmx , EFCoding.edmx Model1.edmx, . -.

. EF ( ) EF, .

+6

All Articles