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


C# SqlServer.SqlServerProcessor类代码示例

本文整理汇总了C#中FluentMigrator.Runner.Processors.SqlServer.SqlServerProcessor的典型用法代码示例。如果您正苦于以下问题:C# SqlServerProcessor类的具体用法?C# SqlServerProcessor怎么用?C# SqlServerProcessor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SqlServerProcessor类属于FluentMigrator.Runner.Processors.SqlServer命名空间,在下文中一共展示了SqlServerProcessor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetUp

 public void SetUp()
 {
     Connection = new SqlConnection(IntegrationTestOptions.SqlServer2012.ConnectionString);
     Processor = new SqlServerProcessor(Connection, new SqlServer2012Generator(), new TextWriterAnnouncer(System.Console.Out), new ProcessorOptions(), new SqlServerDbFactory());
     Connection.Open();
     Processor.BeginTransaction();
 }
开发者ID:BarsBarsovich,项目名称:fluentmigrator,代码行数:7,代码来源:SqlServerSequenceTests.cs

示例2: SqlServerProcessorTests

        public SqlServerProcessorTests()
        {
            Connection = new SqlConnection(@"server=(local)\sqlexpress;uid=;pwd=;Trusted_Connection=yes;database=FluentMigrator");
            Connection.Open();

            Processor = new SqlServerProcessor(Connection, new SqlServer2000Generator(), new TextWriterAnnouncer(System.Console.Out), new ProcessorOptions());
        }
开发者ID:paulbatum,项目名称:fluentmigrator,代码行数:7,代码来源:SqlServerProcessorTests.cs

示例3: ExecuteWithSqlServer

 public void ExecuteWithSqlServer(Action<IMigrationProcessor> test)
 {
     var connection = new SqlConnection(sqlServerConnectionString);
     connection.Open();
     var processor = new SqlServerProcessor(connection, new SqlServerGenerator());
     test(processor);
 }
开发者ID:stevehodgkiss,项目名称:fluentmigrator,代码行数:7,代码来源:IntegrationTestBase.cs

示例4: Run

        public static void Run(string connectionString)
        {
            var firstMigration = typeof(Lucid.Database.Migrations.Y2016.M01.V01);
            var assembly = new SingleAssembly(firstMigration.Assembly);

            var migrationGenerator = new SqlServer2008Generator();
            var announcer = new NullAnnouncer();
            var options = new ProcessorOptions();
            var dbFactory = new SqlServerDbFactory();

            var runnerContext = new RunnerContext(announcer)
            {
                Database = "SqlServer2008",
                Connection = connectionString,
                Targets = new string[] { firstMigration.Assembly.FullName },
                NestedNamespaces = true,
                Namespace = "Lucid.Database.Migrations",
            };

            using (var connection = new SqlConnection(connectionString))
            using (var processor = new SqlServerProcessor(connection, migrationGenerator, announcer, options, dbFactory))
            {
                var runner = new MigrationRunner(assembly, runnerContext, processor);

                runner.MigrateUp();
            }
        }
开发者ID:FlukeFan,项目名称:LucidDotNet,代码行数:27,代码来源:LucidMigrationRunner.cs

示例5: SqlServerProcessorTests

        public SqlServerProcessorTests()
        {
            Connection = new SqlConnection(@"server=(local)\sqlexpress;uid=;pwd=;Trusted_Connection=yes;database=FluentMigrator");
            Connection.Open();

            Processor = new SqlServerProcessor(Connection, new SqlServerGenerator());
        }
开发者ID:stevehodgkiss,项目名称:fluentmigrator,代码行数:7,代码来源:SqlServerProcessorTests.cs

示例6: Setup

 public void Setup()
 {
     Connection = new SqlConnection(IntegrationTestOptions.SqlServer2008.ConnectionString);
     Processor = new SqlServerProcessor(Connection, new SqlServer2008Generator(), new TextWriterAnnouncer(System.Console.Out), new ProcessorOptions(), new SqlServerDbFactory());
     SchemaDumper = new SqlServerSchemaDumper(Processor, new TextWriterAnnouncer(System.Console.Out));
     Connection.Open();
 }
开发者ID:abusby,项目名称:fluentmigrator,代码行数:7,代码来源:SchemaDumpTests.cs

示例7: SqlServerTestTable

        public SqlServerTestTable(SqlServerProcessor processor, params string[] columnDefinitions)
        {
            Connection = processor.Connection;
            Transaction = processor.Transaction;

            Name = "Table" + Guid.NewGuid().ToString("N");
            Create(columnDefinitions);
        }
开发者ID:rtw,项目名称:fluentmigrator,代码行数:8,代码来源:SqlServerTestTable.cs

示例8: SqlServerTestSequence

        public SqlServerTestSequence(SqlServerProcessor processor, string schemaName, string sequenceName)
        {
            _schemaName = schemaName;
            Name = sequenceName;

            Connection = (SqlConnection)processor.Connection;
            Transaction = (SqlTransaction)processor.Transaction;
            Create();
        }
开发者ID:BarsBarsovich,项目名称:fluentmigrator,代码行数:9,代码来源:SqlServerTestSequence.cs

示例9: SqlServerTestTable

        public SqlServerTestTable(string table, SqlServerProcessor processor, string schemaName, params string[] columnDefinitions)
        {
            this.schemaName = schemaName;
            Connection = (SqlConnection)processor.Connection;
            Transaction = (SqlTransaction)processor.Transaction;

            Name = table;

            Create(columnDefinitions);
        }
开发者ID:patrickbird,项目名称:fluentmigrator,代码行数:10,代码来源:SqlServerTestTable.cs

示例10: ExecuteWithSqlServer

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

            var connection = new SqlConnection(serverOptions.ConnectionString);
            connection.Open();
            var processor = new SqlServerProcessor(connection, new SqlServer2000Generator(), new TextWriterAnnouncer(System.Console.Out), new ProcessorOptions());
            test(processor);
        }
开发者ID:Andrea,项目名称:fluentmigrator,代码行数:10,代码来源:IntegrationTestBase.cs

示例11: getRunner

        MigrationRunner getRunner()
        {
            var connectionString = ConfigurationManager.ConnectionStrings["dahliaSQL"].ConnectionString;
            var connection = new SqlConnection(connectionString);
            var assembly = typeof(SqlMigrationService).Assembly;
            var ns = typeof(SqlMigrationService).Namespace;
            var generator = new SqlServer2005Generator();
            var processor = new SqlServerProcessor(connection, generator, new NullAnnouncer(), new ProcessorOptions());

            return new MigrationRunner(assembly, new RunnerContext(new NullAnnouncer()) { Namespace = ns },
                                          processor);
        }
开发者ID:olsonjeffery,项目名称:Dahlia,代码行数:12,代码来源:SqlMigrationRunner.cs

示例12: ExecuteWithSqlServer

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

            var connection = new SqlConnection(serverOptions.ConnectionString);
            var processor = new SqlServerProcessor(connection, new SqlServer2000Generator(), new TextWriterAnnouncer(System.Console.Out), new ProcessorOptions());
            test(processor);

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

示例13: CanApplyIndexConvention

        public void CanApplyIndexConvention()
        {
            var connection = new SqlConnection(sqlServerConnectionString);
             connection.Open();
             var processor = new SqlServerProcessor(connection, new SqlServerGenerator());

             var conventions = new MigrationConventions();
             var runner = new MigrationRunner(conventions, processor);

             runner.Up(new TestIndexNamingConvention());
             processor.TableExists("Users").ShouldBeTrue();

             runner.Down(new TestIndexNamingConvention());
             processor.TableExists("Users").ShouldBeFalse();
        }
开发者ID:rtw,项目名称:fluentmigrator,代码行数:15,代码来源:MigrationRunnerTests.cs

示例14: EnsureMigration

        private void EnsureMigration()
        {
            var connection = new System.Data.SqlClient.SqlConnection(connectionString);
            connection.Open();
            var processor = new SqlServerProcessor(connection, new SqlServer2000Generator(),
                new TextWriterAnnouncer(System.Console.Out), new ProcessorOptions());
            var conventions = new MigrationConventions();
            var versionRunner = new FluentMigrator.Runner.MigrationVersionRunner(conventions, processor,
                new MigrationLoader(conventions), new NullAnnouncer());
            //var runner = new MigrationRunner(conventions, processor, new TextWriterAnnouncer(System.Console.Out), new StopWatch());
            //runner.Up(new TestCreateAndDropTableMigration());
            versionRunner.MigrateUp();

            versionRunner = null;
            connection = null;
        }
开发者ID:rebootd,项目名称:NoSQLIntro1,代码行数:16,代码来源:TestBase.cs

示例15: CanApplyForeignKeyConvention

        public void CanApplyForeignKeyConvention()
        {
            var connection = new SqlConnection(sqlServerConnectionString);
            connection.Open();
            var processor = new SqlServerProcessor(connection, new SqlServerGenerator());

             var conventions = new MigrationConventions();
             var runner = new MigrationRunner(conventions, processor);

             runner.Up(new TestForeignKeyNamingConvention());
             processor.TableExists("Users").ShouldBeTrue();
             processor.ConstraintExists( "Users", "FK_Users_GroupId_Groups_GroupId").ShouldBeTrue();

             runner.Down(new TestForeignKeyNamingConvention());
             processor.TableExists("Users").ShouldBeFalse();
        }
开发者ID:rtw,项目名称:fluentmigrator,代码行数:16,代码来源:MigrationRunnerTests.cs


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