Ejemplo n.º 1
0
            public When_pre_inserting_in_an_invalid_state_with_ef()
            {
                SagaDbContextFactory sagaDbContextFactory =
                    () => new SagaDbContext <Instance, EntityFrameworkInstanceMap>(SagaDbContextFactoryProvider.GetLocalDbConnectionString());

                _repository = new EntityFrameworkSagaRepository <Instance>(sagaDbContextFactory);
            }
Ejemplo n.º 2
0
            public When_pre_inserting_the_state_machine_instance_using_ef()
            {
                ISagaDbContextFactory <Instance> sagaDbContextFactory = new DelegateSagaDbContextFactory <Instance>(
                    () => new InstanceSagaDbContext(SagaDbContextFactoryProvider.GetLocalDbConnectionString()));

                _repository = EntityFrameworkSagaRepository <Instance> .CreatePessimistic(sagaDbContextFactory);
            }
Ejemplo n.º 3
0
            public When_pre_inserting_in_an_invalid_state_using_ef()
            {
                ISagaDbContextFactory <Instance> sagaDbContextFactory = new DelegateSagaDbContextFactory <Instance>(
                    () => new SagaDbContext <Instance, EntityFrameworkInstanceMap>(SagaDbContextFactoryProvider.GetLocalDbConnectionString()));

                _repository = EntityFrameworkSagaRepository <Instance> .CreatePessimistic(sagaDbContextFactory);
            }
Ejemplo n.º 4
0
            protected override void ConfigureInMemoryReceiveEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
            {
                _discarded = GetTask <bool>();

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

                _sagaDbContextFactory =
                    () => new SagaDbContext <SimpleState, SimpleStateMap>(SagaDbContextFactoryProvider.GetLocalDbConnectionString());
                _simpleStateRepository = new Lazy <ISagaRepository <SimpleState> >(() => new EntityFrameworkSagaRepository <SimpleState>(_sagaDbContextFactory));


                configurator.StateMachineSaga(_simpleStateMachine, _simpleStateRepository.Value);

                base.ConfigureInMemoryReceiveEndpoint(configurator);
            }