Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }