Exemple #1
0
        public async Task SendQuery <T>(ConsumeContext <T> context, ISagaQuery <TSaga> query, ISagaPolicy <TSaga, T> policy,
                                        IPipe <SagaConsumeContext <TSaga, T> > next)
            where T : class
        {
            try
            {
                await _repositoryContextFactory.SendQuery(context, query, new SendQuerySagaPipe <TSaga, T>(policy, next)).ConfigureAwait(false);
            }
            catch (SagaException exception)
            {
                context.LogFault(this, exception);
                throw;
            }
            catch (DataException exception)
            {
                context.LogFault(this, exception);
                throw;
            }
            catch (Exception exception)
            {
                context.LogFault(this, exception);

                throw new SagaException(exception.Message, typeof(TSaga), typeof(T), Guid.Empty, exception);
            }
        }
 public Task SendQuery <T>(ConsumeContext <T> context, ISagaQuery <TSaga> query, ISagaPolicy <TSaga, T> policy,
                           IPipe <SagaConsumeContext <TSaga, T> > next)
     where T : class
 {
     return(_repositoryContextFactory.SendQuery(context, query, new SendQuerySagaPipe <TSaga, T>(policy, next)));
 }