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 Task Execute(IDefineCommand command, CancellationToken cancellationToken)
        {
            var     handlerType = typeof(IHandleCommand <>).MakeGenericType(command.GetType());
            dynamic handler     = _lifetimeScope.Resolve(handlerType);

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

            return(validator.Validate((dynamic)command));
        }
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));
        }
Esempio n. 5
0
 public Task Execute(IDefineCommand command)
 {
     var handlerType = typeof(IHandleCommand<>).MakeGenericType(command.GetType());
     dynamic handler = _container.GetInstance(handlerType);
     return handler.Handle((dynamic)command);
 }