How to exclude one table from automatic code first migrations in the Entity Framework?

后端 未结 5 1369
我寻月下人不归
我寻月下人不归 2020-12-16 05:32

I\'m using the Entity Framework in the Code First mode with automatic migrations enabled. Now, I have one entity whose table should not be managed (migrated) by the

5条回答
  •  余生分开走
    2020-12-16 06:26

    It is possible by using another DbContext to access the table in question. Migrations are bound to one DbContext (see Is it possible to have automatic migrations for one DbContext and not for another in the same project?).

提交回复
热议问题