Esempio n. 1
0
        public When_using_EntityFramework()
        {
            _sagaDbContextFactory = new DelegateSagaDbContextFactory <ShoppingChore>(
                () => new ShoppingChoreSagaDbContext(SagaDbContextFactoryProvider.GetLocalDbConnectionString()));

            _repository = new Lazy <ISagaRepository <ShoppingChore> >(() => EntityFrameworkSagaRepository <ShoppingChore> .CreatePessimistic(_sagaDbContextFactory));
        }
 public When_using_EntityFrameworkConcurrencyOptimistic()
 {
     _sagaDbContextFactory = new DelegateSagaDbContextFactory(
         () => new ChoirStateOptimisticSagaDbContext(SagaDbContextFactoryProvider.GetLocalDbConnectionString()));
     _repository = new Lazy <ISagaRepository <ChoirStateOptimistic> >(() =>
                                                                      EntityFrameworkSagaRepository <ChoirStateOptimistic> .CreateOptimistic(_sagaDbContextFactory));
 }
Esempio n. 3
0
        protected override void ConfigureInMemoryReceiveEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
        {
            _discarded = GetTask <bool>();

            _simpleStateMachine = new SimpleStateMachine(x =>
            {
                _discarded.TrySetResult(true);
            });

            _sagaDbContextFactory = new DelegateSagaDbContextFactory(() =>
                                                                     new SimpleStateSagaDbContext(SagaDbContextFactoryProvider.GetLocalDbConnectionString()));

            _simpleStateRepository = new Lazy <ISagaRepository <SimpleState> >(() =>
                                                                               new EntityFrameworkSagaRepository <SimpleState>(_sagaDbContextFactory, System.Data.IsolationLevel.Serializable, new MsSqlLockStatements()));


            configurator.StateMachineSaga(_simpleStateMachine, _simpleStateRepository.Value);

            base.ConfigureInMemoryReceiveEndpoint(configurator);
        }
Esempio n. 4
0
        protected override void ConfigureInMemoryReceiveEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
        {
            _discarded = GetTask <bool>();

            _simpleStateMachine = new SimpleStateMachine(x =>
            {
                _discarded.TrySetResult(true);
            });

            _sagaDbContextFactory = new DelegateSagaDbContextFactory <SimpleState>(() =>
                                                                                   new SimpleStateSagaDbContext(SagaDbContextFactoryProvider.GetLocalDbConnectionString()));

            _simpleStateRepository = new Lazy <ISagaRepository <SimpleState> >(() =>
                                                                               EntityFrameworkSagaRepository <SimpleState> .CreatePessimistic(_sagaDbContextFactory));


            configurator.StateMachineSaga(_simpleStateMachine, _simpleStateRepository.Value);

            base.ConfigureInMemoryReceiveEndpoint(configurator);
        }
 public Locating_an_existing_ef_saga()
 {
     sagaDbContextFactory = () => new SagaDbContext <SimpleSaga, SimpleSagaMap>(SagaDbContextFactoryProvider.GetLocalDbConnectionString());
     _sagaRepository      = new Lazy <ISagaRepository <SimpleSaga> >(() => new EntityFrameworkSagaRepository <SimpleSaga>(sagaDbContextFactory));
 }
Esempio n. 6
0
 public When_using_EntityFrameworkConcurrencyPessimistic()
 {
     _sagaDbContextFactory = new DelegateSagaDbContextFactory(() =>
                                                              new ChoirStatePessimisticSagaDbContext(SagaDbContextFactoryProvider.GetLocalDbConnectionString()));
     _repository = new Lazy <ISagaRepository <ChoirStatePessimistic> >(() =>
                                                                       new EntityFrameworkSagaRepository <ChoirStatePessimistic>(_sagaDbContextFactory, System.Data.IsolationLevel.Serializable,
                                                                                                                                 new MsSqlLockStatements()));
 }