コード例 #1
0
        private static ValidationRuleInstance[] GetValidation(Action <IRuleExpression <TMessage, TCommand> > validation)
        {
            var validationModel = new ValidationDefinition <TMessage, TCommand>();

            validation(validationModel);

            return(validationModel.GetInstances());
        }
コード例 #2
0
        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);
        }