Ejemplo n.º 1
0
 private MigrationRunner GetMigrationRunner(long version, string profile = "")
 {
     if(string.IsNullOrEmpty(ConnectionString))
         throw new EmptyConnectionStringException("ConnectionString property not initialized");
     var options = new MigrationOptions() {PreviewOnly = false, Timeout = 60};
     var factory = new FluentMigrator.Runner.Processors.SqlServer.SqlServer2008ProcessorFactory();
     var processor = factory.Create(ConnectionString, Announcer, options);
     var assembly = Assembly.GetExecutingAssembly();
     var runner = new MigrationRunner(assembly, GetMigrationContext(version, profile), processor);
     return runner;
 }
Ejemplo n.º 2
0
        private MigrationRunner GetMigrationRunner(long version, string profile = "")
        {
            if (string.IsNullOrEmpty(ConnectionString))
            {
                throw new EmptyConnectionStringException("ConnectionString property not initialized");
            }
            var options = new MigrationOptions()
            {
                PreviewOnly = false, Timeout = 60
            };
            var factory   = new FluentMigrator.Runner.Processors.SqlServer.SqlServer2008ProcessorFactory();
            var processor = factory.Create(ConnectionString, Announcer, options);
            var assembly  = Assembly.GetExecutingAssembly();
            var runner    = new MigrationRunner(assembly, GetMigrationContext(version, profile), processor);

            return(runner);
        }