Present
-
One MS SQL DataBase ‘DB’;
-
DbContext1 with migration;
-
DbContext2 migration not needed;
Task
-
How make them live in the same database ‘DB’?
-
How use migration DbContext1 but not to delete data DbContext2 (table names do not intersect)?
-
How write method RecreateDbContext2
sample this
public void RecreateDbContext2(DbContext2 dbContext2)
{
dbContext2<Table1>.DropTable();
dbContext2<Table1>.CreateTable();
...
}
You may want to look at EF6 and multi tenant migrations here