Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public Mediator(ICommandReceivePipe <IReceiveContext <ICommand> > commandReceivePipe,
                 IEventReceivePipe <IReceiveContext <IEvent> > eventReceivePipe,
                 IRequestReceivePipe <IReceiveContext <IRequest> > requestPipe,
                 IPublishPipe <IPublishContext <IEvent> > publishPipe,
                 IGlobalReceivePipe <IReceiveContext <IMessage> > globalPipe, IDependancyScope scope = null)
 {
     _commandReceivePipe = commandReceivePipe;
     _eventReceivePipe   = eventReceivePipe;
     _requestPipe        = requestPipe;
     _publishPipe        = publishPipe;
     _globalPipe         = globalPipe;
     _scope = scope;
 }
Ejemplo n.º 3
0
        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);
        }