Possible to add migration using EF DbMigrator

2019-09-04 09:03发布

问题:

Is it possible to add a migration file using DbMigrator in code instead of through the powershell commands?

回答1:

DbMigrator is class for running migrations. Classes for creating migration are in System.Data.Entity.Migrations.Design. ToolingFacade is called by powershell commands. Other classes represents low level API for creating migration code.