Exemple #1
0
        public ISagaRepository <T> CreateSagaRepository <T>() where T : class, ISaga
        {
            var repository = _container.GetInstance <ISagaRepository <T> >();

            var scopeProvider = new SimpleInjectorSagaScopeProvider <T>(_container);

            var sagaRepository = new ScopeSagaRepository <T>(repository, scopeProvider);

            return(sagaRepository);
        }
Exemple #2
0
        public ISagaRepository <T> CreateSagaRepository <T>(Action <ConsumeContext> scopeAction)
            where T : class, ISaga
        {
            var repository = _container.GetInstance <ISagaRepository <T> >();

            var scopeProvider = new SimpleInjectorSagaScopeProvider <T>(_container);
            // if (scopeAction != null)
            //     scopeProvider.AddScopeAction(scopeAction);

            var sagaRepository = new ScopeSagaRepository <T>(repository, scopeProvider);

            return(sagaRepository);
        }