Validation rule negate another rule. When embedded rule returns no errors, than this rule return an error. When embedded rule return errors, than the rule returns no errors.
More...
Validation rule negate another rule. When embedded rule returns no errors, than this rule return an error. When embedded rule return errors, than the rule returns no errors.
var schema = new Schema().WithRule(
new NotRule(
new ValueComparisonRule(
"EQ", 1)));
schema.Validate(1);
schema.Validate(5);
See IValidationRule
◆ NotRule()
Creates a new validation rule and sets its values
- Parameters
-
rule | a rule to be negated. |
◆ Validate()
void PipServices3.Commons.Validate.NotRule.Validate |
( |
string |
path, |
|
|
Schema |
schema, |
|
|
object |
value, |
|
|
List< ValidationResult > |
results |
|
) |
| |
Validates a given value against this rule.
- Parameters
-
path | a dot notation path to the value. |
schema | a schema this rule is called from |
value | a value to be validated. |
results | a list with validation results to add new results. |
The documentation for this class was generated from the following file: