コード例 #1
0
ファイル: QueueFixture.cs プロジェクト: RhysC/SqlQueue
        public QueueFixture()
        {
            try
            {
                var configuration = new DbMigrationsConfiguration
                {
                    ContextType = typeof(QueueDataContext),
                    MigrationsAssembly = typeof(QueueDataContext).Assembly,
                    TargetDatabase = new DbConnectionInfo("QueueDataContext"),
                    MigrationsNamespace = typeof(InitialCreate).Namespace,
                    AutomaticMigrationDataLossAllowed = true
                };

                var migrator = new DbMigrator(configuration);
                //Update / rollback to "MigrationName"
                migrator.Update("0");
                migrator.Update();
                _sut = new SqlQueueImpl(new Infrastructure.DatabaseContextFactory());
            }
            catch (Exception ex)
            {
                if (Debugger.IsAttached) Debugger.Break();
                Console.WriteLine(ex);
                throw;
            }
        }
コード例 #2
0
        public QueueFixture()
        {
            try
            {
                var configuration = new DbMigrationsConfiguration
                {
                    ContextType         = typeof(QueueDataContext),
                    MigrationsAssembly  = typeof(QueueDataContext).Assembly,
                    TargetDatabase      = new DbConnectionInfo("QueueDataContext"),
                    MigrationsNamespace = typeof(InitialCreate).Namespace,
                    AutomaticMigrationDataLossAllowed = true
                };

                var migrator = new DbMigrator(configuration);
                //Update / rollback to "MigrationName"
                migrator.Update("0");
                migrator.Update();
                _sut = new SqlQueueImpl(new Infrastructure.DatabaseContextFactory());
            }
            catch (Exception ex)
            {
                if (Debugger.IsAttached)
                {
                    Debugger.Break();
                }
                Console.WriteLine(ex);
                throw;
            }
        }