Exemple #1
0
        private void DatabaseSqlFile(string sqlFileName, string folder = "", bool suppressTransaction = false, string assemblyPath = "")
        {
            var factory = new EntityFrameworkViewMigrationsSectionFactory();
            var configurationSection = factory.GetSectionFromCurrentAssembly(assemblyPath);

            this.dbMigrationPath   = new DbMigrationPath(configurationSection.DatabaseProject);
            this.initialDataParser = new InitialDataParser(this.dbMigrationPath);

            this.Sql(SqlDataParser.WrapSqlFileWithExec(this.GetMigrationScript(sqlFileName, folder)), suppressTransaction);
        }
Exemple #2
0
        protected void Seed()
        {
            // This is not the best solution... because i can not use the SeedDbMigration. It has wrong calling assemlby :( F**K THIS SHIT
            var assemblyPath         = Assembly.GetCallingAssembly().EscapedCodeBase; // Can not call inside the Factory/Initialize !!!
            var factory              = new EntityFrameworkViewMigrationsSectionFactory();
            var configurationSection = factory.GetSectionFromCurrentAssembly(assemblyPath);

            this.dbMigrationPath   = new DbMigrationPath(configurationSection.DatabaseProject);
            this.initialDataParser = new InitialDataParser(this.dbMigrationPath);

            foreach (string sql in this.initialDataParser.Parse())
            {
                this.Sql(SqlDataParser.WrapSqlFileWithExec(sql));
            }
        }