这也适用:var configuration = new MyDbContextConfiguration();configuration.TargetDatabase = new DbConnectionInfo( database.ConnectionString, database.ProviderName);var migrator = new DbMigrator(configuration);migrator.Update();您也可以致电:migrator.GetPendingMigrations();以获得需要应用的迁移列表。