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