Exemplo n.º 1
0
            public When_pre_inserting_the_state_machine_instance_using_ef()
            {
                ISagaDbContextFactory <Instance> sagaDbContextFactory = new DelegateSagaDbContextFactory <Instance>(
                    () => new InstanceSagaDbContext(LocalDbConnectionStringProvider.GetLocalDbConnectionString()));

                _repository = EntityFrameworkSagaRepository <Instance> .CreatePessimistic(sagaDbContextFactory);
            }
Exemplo n.º 2
0
 public void Apply(Type dbContextType, DbContextOptionsBuilder dbContextOptionsBuilder)
 {
     dbContextOptionsBuilder.UseSqlServer(LocalDbConnectionStringProvider.GetLocalDbConnectionString(), m =>
     {
         m.MigrationsAssembly(Assembly.GetExecutingAssembly().GetName().Name);
         m.MigrationsHistoryTable($"__{dbContextType.Name}");
     });
 }
Exemplo n.º 3
0
            protected void ConfigureRegistration(IBusRegistrationConfigurator configurator)
            {
                _connectionString = LocalDbConnectionStringProvider.GetLocalDbConnectionString();

                configurator.AddSagaStateMachine <TestStateMachineSaga, TestInstance>()
                .DapperRepository(_connectionString);

                configurator.AddBus(provider => BusControl);
            }
Exemplo n.º 4
0
            protected void ConfigureRegistration(IBusRegistrationConfigurator configurator)
            {
                configurator.AddSagaStateMachine <TestStateMachineSaga, TestInstance>()
                .EntityFrameworkRepository(r =>
                {
                    r.ConcurrencyMode = ConcurrencyMode.Pessimistic;

                    r.DatabaseFactory(provider => () => new TestInstanceDbContext(LocalDbConnectionStringProvider.GetLocalDbConnectionString()));
                });

                configurator.AddBus(provider => BusControl);
            }