Switching from an Entity Framework Database First to Code First

Our solution is currently based on the Entity Framework Database. We have a T4 template that generates repository classes from EDMX.

We are considering our planned approach for releasing changes, especially database changes. If we first continue to work with the database, we will need to separately generate scripts to change the development and other databases.

It seems that with Code First, we simply change the model and generate scripts to modify various databases. It seems simpler, does not require manual scripting and risk reduction.

So, if we make the switch, this is just the case:

  • Moving previously created models from EDMX to our Project to objects (they are all in the same class file) to (preferably separately) Class files in the folder inside the Entities Project
  • Adjust the T4 template to select models from your new location.
  • No longer use EDMX and database updates
  • When we want to make changes to the model by simply changing the classes (previously, but not generated)
  • Using the first migration steps to implement changes in the test and other databases

Finally, how do we see the relationships between the models? Is there a way to create a chart?

Thanks,

Chris

+4
source share
1 answer

, . . EF Reverse Poco Generator, Model/Poco. . .

, , .

, " " MS Sql, , . , , , . EF VS.

, , , Poco. - .

, , . EF Reverse Poco db, . T4 , XML ( T4 Toolbox ), .

- , . , EF/Poco , T4. , , , , VS. , . , .

0

All Articles