예제 #1
0
        public IRequestReceivePipe <IReceiveContext <IRequest> > Build()
        {
            IRequestReceivePipe <IReceiveContext <IRequest> > current = null;

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

            return(current);
        }
예제 #2
0
        public IRequestReceivePipe <IReceiveContext <IRequest> > Build()
        {
            IRequestReceivePipe <IReceiveContext <IRequest> > current = null;

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

            return(current);
        }