public static void ConfigureSqlGeneratorForAllProviders( this DbMigrationsConfiguration migrationConfiguration) { var providers = migrationConfiguration.GetAvailableProviders(); foreach (var providerName in providers) { var currentSqlGenerator = migrationConfiguration.GetSqlGenerator(providerName); var newSqlGenerator = new MigrationSqlGeneratorWithDiscriminatorIndexSupport(currentSqlGenerator); migrationConfiguration.SetSqlGenerator(providerName, newSqlGenerator); } }
public static void ConfigureSqlGeneratorForAllProviders( this DbMigrationsConfiguration migrationConfiguration) { // Get Providers as copied list, the iteration edits the underlying enumerable var providers = migrationConfiguration.GetAvailableProviders().ToList(); foreach (var providerName in providers) { var currentSqlGenerator = migrationConfiguration.GetSqlGenerator(providerName); var newSqlGenerator = new MigrationSqlGeneratorWithDiscriminatorIndexSupport(currentSqlGenerator); migrationConfiguration.SetSqlGenerator(providerName, newSqlGenerator); } }