public void Execute <TCommand>(TCommand command) where TCommand : ICommand
        {
            IEnumerable <ICommandValidator <TCommand> > validators = _componentsResolver.GetAll <ICommandValidator <TCommand> >();

            if (validators != null && validators.Any())
            {
                foreach (ICommandValidator <TCommand> validator in validators)
                {
                    validator.Validate(command);
                }
            }

            _rabbitMQConnection.PublishToQueue(command.GetType().Name, command);
        }
Exemplo n.º 2
0
 protected virtual void ReturnOnErorr(byte[] data)
 {
     RabbitConnection.PublishToQueue(BusEndpoint, data);
     Thread.Sleep(timeOut);
 }