示例#1
0
 public When_using_EntityFrameworkConcurrencyOptimistic()
 {
     _sagaDbContextFactory = new DelegateSagaDbContextFactory <ChoirStateOptimistic>(
         () => new SagaDbContext <ChoirStateOptimistic, EntityFrameworkChoirStateMap>(SagaDbContextFactoryProvider.GetLocalDbConnectionString()));
     _repository = new Lazy <ISagaRepository <ChoirStateOptimistic> >(() => EntityFrameworkSagaRepository <ChoirStateOptimistic> .CreateOptimistic(_sagaDbContextFactory));
 }
 public static EntityFrameworkSagaRepository <TSaga> CreateOptimistic(ISagaDbContextFactory sagaDbContextFactory,
                                                                      Func <IQueryable <TSaga>, IQueryable <TSaga> > queryCustomization = null)
 {
     return(new EntityFrameworkSagaRepository <TSaga>(sagaDbContextFactory, IsolationLevel.ReadCommitted, queryCustomization, null));
 }
示例#3
0
 public When_using_EntityFrameworkConcurrencyFail()
 {
     _sagaDbContextFactory = new DelegateSagaDbContextFactory <ChoirState>(
         () => new SagaDbContext <ChoirState, EntityFrameworkChoirStateMap>(SagaDbContextFactoryProvider.GetLocalDbConnectionString()));
     _repository = new Lazy <ISagaRepository <ChoirState> >(() => new EntityFrameworkSagaRepository <ChoirState>(_sagaDbContextFactory, optimistic: true));
 }