Exemplo n.º 1
0
        static int Main(string[] args)
        {
            var migrateNoInteractive = false;
            var appConfiguration     = new AppConfiguration
            {
                SupportedDialects = new List <string>
                {
                    MigratorDatabaseDialect.SqlServer,
                },
                MigrationAssemblies = new[]
                {
                    typeof(DatabaseTagTypes).Assembly,
                }
            };

            IApplicationRunner applicationRunner = new CommandLineRunner(appConfiguration, args);

            if (args != null && args.Contains(CommandLineRunner.NoInteractiveFlag))
            {
                migrateNoInteractive = true;

                args = args.Where(x => !x.Contains(CommandLineRunner.NoInteractiveFlag)).ToArray();
            }

            if (args == null || args.Length == 0)
            {
                applicationRunner = new ConfigurationRunner(appConfiguration, migrateNoInteractive);
            }

            return(applicationRunner.RunApplication());
        }
Exemplo n.º 2
0
 public void Initialize()
 {
     this.resolver = new DependencyResolver();
     this.resolver.Bind <ITypeMapping>().ToSingleton <TypeMapping>();
     this.resolver.Bind <IConfigurationReaderVersion>().To <ConfigurationReaderVersion2>();
     this.resolver.Bind <ReaderConfigurationMapping>().ToSingleton();
     this.resolver.Bind <WriterConfigurationMapping>().ToSingleton();
     this.resolver.Create <CoreModule>().Initialize();
     this.resolver.Create <CsharpModule>().Initialize();
     this.resolver.Create <TsqlModule>().Initialize();
     this.reader = this.resolver.Create <ConfigurationsReader>();
     this.runner = this.resolver.Create <ConfigurationRunner>();
     this.output = this.resolver.Create <MemoryOutput>();
 }
Exemplo n.º 3
0
 public RunCommand(List <ModuleBase> modules, IDependencyResolver resolver, ConfigurationRunner runner)
 {
     this.modules  = modules;
     this.resolver = resolver;
     this.runner   = runner;
 }