public ICommandReceivePipe <IReceiveContext <ICommand> > Build() { ICommandReceivePipe <IReceiveContext <ICommand> > current = null; if (_specifications.Any()) { for (int i = _specifications.Count - 1; i >= 0; i--) { if (i == _specifications.Count - 1) { var thisPipe = new CommandReceivePipe <IReceiveContext <ICommand> >(_specifications[i], null, _resolver); current = thisPipe; } else { var thisPipe = new CommandReceivePipe <IReceiveContext <ICommand> >(_specifications[i], current, _resolver); current = thisPipe; } } } else { current = new CommandReceivePipe <IReceiveContext <ICommand> >(new EmptyPipeSpecification <IReceiveContext <ICommand> >(), null, _resolver); } return(current); }
public ICommandReceivePipe <IReceiveContext <ICommand> > Build() { ICommandReceivePipe <IReceiveContext <ICommand> > current = null; if (_specifications.Any()) { for (int i = _specifications.Count - 1; i >= 0; i--) { current = i == _specifications.Count - 1 ? new CommandReceivePipe <IReceiveContext <ICommand> >(_specifications[i], null, _resolver, _messageHandlerRegistry) : new CommandReceivePipe <IReceiveContext <ICommand> >(_specifications[i], current, _resolver, _messageHandlerRegistry); } } else { current = new CommandReceivePipe <IReceiveContext <ICommand> >(new EmptyPipeSpecification <IReceiveContext <ICommand> >(), null, _resolver, _messageHandlerRegistry); } return(current); }