EF CTP4 - creating tables but not deleting DB

I have one hosted SQL Server DB and I do not have permission to delete it. How to make EF create tables from my domain classes? RecreateDatabaseIfModelChanges and AlwaysRecreateDatabase try to delete the DB, CreateDatabaseOnlyIfNotExists does not create the table.

thank

+3
source share
1 answer

CreateDatabaseOnlyIfNotExists is the default strategy. This means that you do not even need to install it through Database.SetInitializer. EF Code First, check the database, and if you could not find a name with the same name as the full name of your context, it will create it for you.

0
source

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


All Articles