Entity Framework 4.1 Code First EDMX Issue

The way to handle large projects using EF CF is as follows:

  • Creating a Data Model (EDMX)
  • Disable the Model-First code generation feature for this model by clearing the Custom Tool property.
  • Use the Entity Framework POCO Generator extension to add the appropriate template files (t4) to the project
  • Customize the template files to follow the specific coding rules that we follow.

It all looks good in concept, but when we launch the project, EF seems to think that we are using the Model-First approach. This is not so, since we do not want the EDMX model to be mapped to any database. We expect the database to be created at run time if the model has changed.

So, how can we remove the EDMX database display wait?

+2
source share
1 answer

Not using EDMX. EDMX - mapping. Once you use EDMX, you first use the first model or database. First, the code means the absence of EDMX and code generators. The code in the title of the approach means you must write this code. The only way to get the entities and collation generated in the code is when you have an existing database and you use EF Power Tools, but if you do not have a database, you do not have such support.

+4
source

Source: https://habr.com/ru/post/1270279/


All Articles