public AutofacScopeSagaRepository(ISagaRepository <TSaga> repository, ILifetimeScopeRegistry <TId> registry, string name,
                                          Action <ContainerBuilder, ConsumeContext> configureScope)
        {
            ISagaScopeProvider <TSaga> scopeProvider =
                new AutofacSagaScopeProvider <TSaga>(new RegistryLifetimeScopeProvider <TId>(registry), name, configureScope);

            _repository = new ScopeSagaRepository <TSaga>(repository, scopeProvider);
        }
        ISagaRepository <T> ISagaRepositoryFactory.CreateSagaRepository <T>()
        {
            var repository = _scopeProvider.LifetimeScope.Resolve <ISagaRepository <T> >();

            var scopeProvider = new AutofacSagaScopeProvider <T>(_scopeProvider, _name, _configureScope);

            return(new ScopeSagaRepository <T>(repository, scopeProvider));
        }
예제 #3
0
        public AutofacScopeSagaRepository(ISagaRepository <TSaga> repository, ILifetimeScopeRegistry <TId> registry, string name)
        {
            ISagaScopeProvider <TSaga> scopeProvider = new AutofacSagaScopeProvider <TSaga>(new RegistryLifetimeScopeProvider <TId>(registry), name);

            _repository = new ScopeSagaRepository <TSaga>(repository, scopeProvider);
        }
예제 #4
0
        public AutofacSagaRepository(ISagaRepository <TSaga> repository, ILifetimeScope scope, Action <ContainerBuilder, ConsumeContext> configureScope, string name = "message")
        {
            ISagaScopeProvider <TSaga> scopeProvider = new AutofacSagaScopeProvider <TSaga>(new SingleLifetimeScopeProvider(scope), name, configureScope);

            _repository = new ScopeSagaRepository <TSaga>(repository, scopeProvider);
        }
예제 #5
0
        public AutofacSagaRepository(ISagaRepository <TSaga> repository, ILifetimeScope scope, string name = "message")
        {
            ISagaScopeProvider <TSaga> scopeProvider = new AutofacSagaScopeProvider <TSaga>(new SingleLifetimeScopeProvider(scope), name);

            _repository = new ScopeSagaRepository <TSaga>(repository, scopeProvider);
        }