Exemplo n.º 1
0
 async Task ISagaRepository <TSaga> .SendQuery <T>(SagaQueryConsumeContext <TSaga, T> context, ISagaPolicy <TSaga, T> policy, IPipe <SagaConsumeContext <TSaga, T> > next)
 {
     using (var nestedContainer = _container.GetNestedContainer())
     {
         SagaQueryConsumeContext <TSaga, T> proxy = context.CreateQueryScope(nestedContainer);
         await _repository.SendQuery(proxy, policy, next).ConfigureAwait(false);
     }
 }
Exemplo n.º 2
0
        public async Task SendQuery <T>(SagaQueryConsumeContext <TSaga, T> context, ISagaPolicy <TSaga, T> policy, IPipe <SagaConsumeContext <TSaga, T> > next) where T : class
        {
            using (var scope = this._services.CreateScope())
            {
                SagaQueryConsumeContext <TSaga, T> proxy = context.CreateQueryScope(scope);

                await this._repository.SendQuery(proxy, policy, next).ConfigureAwait(false);
            }
        }
Exemplo n.º 3
0
        async Task ISagaRepository <TSaga> .SendQuery <T>(SagaQueryConsumeContext <TSaga, T> context, ISagaPolicy <TSaga, T> policy,
                                                          IPipe <SagaConsumeContext <TSaga, T> > next)
        {
            using (var lifetimeScope = _scope.BeginLifetimeScope(_name))
            {
                SagaQueryConsumeContext <TSaga, T> proxy = context.CreateQueryScope(lifetimeScope);

                await _repository.SendQuery(proxy, policy, next).ConfigureAwait(false);
            }
        }
Exemplo n.º 4
0
        public async Task SendQuery <T>(SagaQueryConsumeContext <TSaga, T> context, ISagaPolicy <TSaga, T> policy, IPipe <SagaConsumeContext <TSaga, T> > next)
            where T : class
        {
            using (var container = _container.CreateChildContainer())
            {
                SagaQueryConsumeContext <TSaga, T> proxy = context.CreateQueryScope(container);

                await _repository.SendQuery(proxy, policy, next).ConfigureAwait(false);
            }
        }
        async Task ISagaRepository <TSaga> .SendQuery <T>(SagaQueryConsumeContext <TSaga, T> context, ISagaPolicy <TSaga, T> policy,
                                                          IPipe <SagaConsumeContext <TSaga, T> > next)
        {
            using (var nestedContainer = _container.GetNestedContainer())
            {
                SagaQueryConsumeContext <TSaga, T> proxy = context.CreateQueryScope(nestedContainer);

                proxy.GetOrAddPayload <IStateMachineActivityFactory>(() => new StructureMapStateMachineActivityFactory());

                await _repository.SendQuery(proxy, policy, next).ConfigureAwait(false);
            }
        }
        async Task ISagaRepository <TSaga> .SendQuery <T>(SagaQueryConsumeContext <TSaga, T> context, ISagaPolicy <TSaga, T> policy,
                                                          IPipe <SagaConsumeContext <TSaga, T> > next)
        {
            using (var lifetimeScope = _scope.BeginLifetimeScope(_name))
            {
                SagaQueryConsumeContext <TSaga, T> proxy = context.CreateQueryScope(lifetimeScope);

                proxy.GetOrAddPayload <IStateMachineActivityFactory>(() => new AutofacStateMachineActivityFactory());

                await _repository.SendQuery(proxy, policy, next).ConfigureAwait(false);
            }
        }