当前位置: 首页>>代码示例>>C#>>正文


C# TextWriterAnnouncer.Heading方法代码示例

本文整理汇总了C#中FluentMigrator.Runner.Announcers.TextWriterAnnouncer.Heading方法的典型用法代码示例。如果您正苦于以下问题:C# TextWriterAnnouncer.Heading方法的具体用法?C# TextWriterAnnouncer.Heading怎么用?C# TextWriterAnnouncer.Heading使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FluentMigrator.Runner.Announcers.TextWriterAnnouncer的用法示例。


在下文中一共展示了TextWriterAnnouncer.Heading方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExecuteWithSqlite

        protected static void ExecuteWithSqlite(Action<IMigrationProcessor> test, IntegrationTestOptions.DatabaseServerOptions serverOptions)
        {
            if (!serverOptions.IsEnabled)
                return;

            var announcer = new TextWriterAnnouncer(System.Console.Out);
            announcer.Heading("Testing Migration against SQLite");

            var factory = new SqliteDbFactory();
            using (var connection = factory.CreateConnection(serverOptions.ConnectionString))
            {
                var processor = new SqliteProcessor(connection, new SqliteGenerator(), announcer, new ProcessorOptions(), factory);
                test(processor);
            }
        }
开发者ID:rebootd,项目名称:fluentmigrator,代码行数:15,代码来源:IntegrationTestBase.cs

示例2: ExecuteWithMySql

        protected static void ExecuteWithMySql(Action<IMigrationProcessor> test, IntegrationTestOptions.DatabaseServerOptions serverOptions)
        {
            if (!serverOptions.IsEnabled)
                return;

            var announcer = new TextWriterAnnouncer(System.Console.Out);
            announcer.Heading("Testing Migration against MySQL Server");

            using (var connection = new MySqlConnection(serverOptions.ConnectionString))
            {
                var processor = new MySqlProcessor(connection, new MySqlGenerator(), announcer, new ProcessorOptions(), new MySqlDbFactory());
                test(processor);
            }
        }
开发者ID:rebootd,项目名称:fluentmigrator,代码行数:14,代码来源:IntegrationTestBase.cs

示例3: ExecuteWithSqlServer2014

        protected static void ExecuteWithSqlServer2014(Action<IMigrationProcessor> test, bool tryRollback)
        {

            var serverOptions = IntegrationTestOptions.SqlServer2014;

            if (!serverOptions.IsEnabled)
                return;

            var announcer = new TextWriterAnnouncer(System.Console.Out);
            announcer.Heading("Testing Migration against MS SQL Server 2014");
            var generator = new SqlServer2014Generator();

            ExecuteWithSqlServer(serverOptions, announcer, generator, test, tryRollback);
        }
开发者ID:SaltyDH,项目名称:fluentmigrator,代码行数:14,代码来源:IntegrationTestBase.cs

示例4: Execute

        private void Execute(string task)
        {
            tbAnnouncer.Clear();

            var version = (int)numVersion.Value;
            var steps = (int)numSteps.Value;
            var tags = new List<string>();
            var profile = tbProfile.Text;
            foreach (var item in lbTags.SelectedItems)
            {
                tags.Add(item.ToString());
            }

            var announcer = new TextWriterAnnouncer(new TextBoxStreamWriter(tbAnnouncer));
            announcer.Heading("Migrate database");

            var runnerContext = new RunnerContext(announcer)
            {
                Database = "SqlServer2008",
                Connection = ConfigurationManager.ConnectionStrings["FluentMigrator"].ConnectionString,

                Target = "DatabaseProject.dll",
                PreviewOnly = false,
                Namespace = "DatabaseProject",
                NestedNamespaces = true,
                Task = task,
                Version = version,
                Steps = steps,
                Tags = tags,
                //WorkingDirectory = "C:\\temp",
                Profile = profile,
                Timeout = 30,
                TransactionPerSession = true
            };

            var executor = new TaskExecutor(runnerContext);


            try
            {
                executor.Execute();
            }
            catch (Exception ex)
            {
                tbAnnouncer.AppendText("Exception: " + ex.Message);
            }

        }
开发者ID:oyvindfanebust,项目名称:FluentMigratorDemo,代码行数:48,代码来源:frmMain.cs

示例5: ExecuteWithFirebird

        protected static void ExecuteWithFirebird(Action<IMigrationProcessor> test, IntegrationTestOptions.DatabaseServerOptions serverOptions)
        {
            if (!serverOptions.IsEnabled)
                return;

            var announcer = new TextWriterAnnouncer(System.Console.Out);
            announcer.ShowSql = true;
            announcer.Heading("Testing Migration against Firebird Server");
            
            if (!System.IO.File.Exists("fbtest.fdb"))
            {
                FbConnection.CreateDatabase(serverOptions.ConnectionString);
            }

            using (var connection = new FbConnection(serverOptions.ConnectionString))
            {
                var options = FirebirdOptions.AutoCommitBehaviour();
                var processor = new FirebirdProcessor(connection, new FirebirdGenerator(options), announcer, new ProcessorOptions(), new FirebirdDbFactory(), options);

                try
                {
                    test(processor);
                }
                catch (Exception)
                {
                    if (!processor.WasCommitted)
                        processor.RollbackTransaction();
                    throw;
                }

                connection.Close();
            }
        }
开发者ID:SaltyDH,项目名称:fluentmigrator,代码行数:33,代码来源:IntegrationTestBase.cs

示例6: ExecuteWithPostgres

        protected static void ExecuteWithPostgres(Action<IMigrationProcessor> test, IntegrationTestOptions.DatabaseServerOptions serverOptions, Boolean tryRollback)
        {
            if (!serverOptions.IsEnabled)
                return;

            var announcer = new TextWriterAnnouncer(System.Console.Out);
            announcer.Heading("Testing Migration against Postgres");

            using (var connection = new NpgsqlConnection(serverOptions.ConnectionString))
            {
                var processor = new PostgresProcessor(connection, new PostgresGenerator(), new TextWriterAnnouncer(System.Console.Out), new ProcessorOptions(), new PostgresDbFactory());

                test(processor);

                if (!processor.WasCommitted)
                {
                    processor.RollbackTransaction();
                }
            }
        }
开发者ID:SaltyDH,项目名称:fluentmigrator,代码行数:20,代码来源:IntegrationTestBase.cs


注:本文中的FluentMigrator.Runner.Announcers.TextWriterAnnouncer.Heading方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。