예제 #1
0
        public SlowConcurrentSaga_Specs()
        {
            _sagaRepository = new Lazy <ISagaRepository <SlowConcurrentSaga> >(() =>
                                                                               AzureTableSagaRepository <SlowConcurrentSaga> .Create(() => TestCloudTable));

            _sagaTestHarness = BusTestHarness.StateMachineSaga(new SlowConcurrentSagaStateMachine(), _sagaRepository.Value);
        }
        public SlowConcurrentSaga_Specs()
        {
            // rowlock statements that don't work to cause a deadlock.
            var notWorkingRowLockStatements = new SqlLockStatementProvider("dbo", "SELECT * FROM \"{1}\" WHERE \"CorrelationId\" = @p0");

            // add new migration by calling
            // dotnet ef migrations add --context "SagaDbContext``2" Init  -v
            _sagaRepository = new Lazy <ISagaRepository <SlowConcurrentSaga> >(() =>
                                                                               EntityFrameworkSagaRepository <SlowConcurrentSaga> .CreatePessimistic(
                                                                                   () => new SlowConcurrentSagaContextFactory().CreateDbContext(DbContextOptionsBuilder),
                                                                                   notWorkingRowLockStatements));

            _sagaTestHarness = BusTestHarness.StateMachineSaga(new SlowConcurrentSagaStateMachine(), _sagaRepository.Value);
        }