private static ValidationRuleInstance[] GetValidation(Action <IRuleExpression <TMessage, TCommand> > validation)
        {
            var validationModel = new ValidationDefinition <TMessage, TCommand>();

            validation(validationModel);

            return(validationModel.GetInstances());
        }
        public ICommandConfigurationExpression <TMessage, TCommand> Enforce(
            Action <IRuleExpression <TMessage, TCommand> > validation, Action <IRuleOptionsExpression <TCommand> > options)
        {
            var validationModel = new ValidationDefinition <TMessage, TCommand>();

            validation(validationModel);

            options(validationModel);

            _CommandDefinition.AddValidationRules(validationModel.GetInstances());

            return(this);
        }
Exemplo n.º 3
0
 public TargetHelper(ValidationDefinition <TMessage, TCommand> validationDefinition)
 {
     _validationDefinition = validationDefinition;
 }