Пример #1
0
        public async Task Send(T context, IPipe <T> next)
        {
            try
            {
                _behavior.PreSend();

                await next.Send(context);

                _behavior.PostSend();
            }
            catch (Exception ex)
            {
                _behavior.SendFault(ex);

                throw;
            }
        }
Пример #2
0
        public async Task Send(TContext context, IPipe <TContext> next)
        {
            try
            {
                await _behavior.PreSend().ConfigureAwait(false);

                await next.Send(context).ConfigureAwait(false);

                await _behavior.PostSend().ConfigureAwait(false);
            }
            catch (Exception ex)
            {
                if (!_exceptionFilter.Match(ex))
                {
                    throw;
                }

                await _behavior.SendFault(ex).ConfigureAwait(false);

                throw;
            }
        }