public IEventReceivePipe <IReceiveContext <IEvent> > Build()
        {
            IEventReceivePipe <IReceiveContext <IEvent> > current = null;

            if (_specifications.Any())
            {
                for (int i = _specifications.Count - 1; i >= 0; i--)
                {
                    if (i == _specifications.Count - 1)
                    {
                        var thisPipe =
                            new EventReceivePipe <IReceiveContext <IEvent> >(_specifications[i], null, _resolver);
                        current = thisPipe;
                    }
                    else
                    {
                        var thisPipe =
                            new EventReceivePipe <IReceiveContext <IEvent> >(_specifications[i], current, _resolver);
                        current = thisPipe;
                    }
                }
            }
            else
            {
                current = new EventReceivePipe <IReceiveContext <IEvent> >(new EmptyPipeSpecification <IReceiveContext <IEvent> >(), null, _resolver);
            }

            return(current);
        }
        public IEventReceivePipe <IReceiveContext <IEvent> > Build()
        {
            IEventReceivePipe <IReceiveContext <IEvent> > current = null;

            if (_specifications.Any())
            {
                for (int i = _specifications.Count - 1; i >= 0; i--)
                {
                    current = i == _specifications.Count - 1
                        ? new EventReceivePipe <IReceiveContext <IEvent> >(_specifications[i], null, _resolver, _messageHandlerRegistry)
                        : new EventReceivePipe <IReceiveContext <IEvent> >(_specifications[i], current, _resolver, _messageHandlerRegistry);
                }
            }
            else
            {
                current = new EventReceivePipe <IReceiveContext <IEvent> >(new EmptyPipeSpecification <IReceiveContext <IEvent> >(), null, _resolver, _messageHandlerRegistry);
            }

            return(current);
        }