Esempio n. 1
0
        public ValidationResult Validate(IDefineCommand command)
        {
            var     validatedType = typeof(IValidator <>).MakeGenericType(command.GetType());
            dynamic validator     = _container.GetInstance(validatedType);

            return(validator.Validate((dynamic)command));
        }
        public ValidationResult Validate(IDefineCommand command)
        {
            var     validatedType = typeof(IValidator <>).MakeGenericType(command.GetType());
            dynamic validator     = _lifetimeScope.Resolve(validatedType);

            return(validator.Validate((dynamic)command));
        }
        public Task Execute(IDefineCommand command, CancellationToken cancellationToken)
        {
            var     handlerType = typeof(IHandleCommand <>).MakeGenericType(command.GetType());
            dynamic handler     = _lifetimeScope.Resolve(handlerType);

            return(handler.Handle((dynamic)command, cancellationToken));
        }
Esempio n. 4
0
        public Task Execute(IDefineCommand command)
        {
            var     handlerType = typeof(IHandleCommand <>).MakeGenericType(command.GetType());
            dynamic handler     = _container.GetInstance(handlerType);

            return(handler.Handle((dynamic)command));
        }
 public void EnqueueCommand(IDefineCommand command, CancellationToken cancellationToken)
 {
     _commandQueue.Add(command, cancellationToken);
 }
Esempio n. 6
0
 public Task Execute(IDefineCommand command)
 {
     var handlerType = typeof(IHandleCommand<>).MakeGenericType(command.GetType());
     dynamic handler = _container.GetInstance(handlerType);
     return handler.Handle((dynamic)command);
 }