Validation rule to check that value is excluded from the list of constants.
More...
|
readonly object [] | _values |
|
Validation rule to check that value is excluded from the list of constants.
var schema =
new Schema().WithRule(
new ExcludedRule(1, 2, 3));
schema.Validate(2);
schema.Validate(10);
◆ ExcludedRule()
PipServices3.Commons.Validate.ExcludedRule.ExcludedRule |
( |
params object [] |
values | ) |
|
Creates a new validation rule and sets its values.
- Parameters
-
values | a list of constants that value must be excluded from |
◆ Validate()
void PipServices3.Commons.Validate.ExcludedRule.Validate |
( |
string |
path, |
|
|
Schema |
schema, |
|
|
object |
value, |
|
|
List< ValidationResult > |
results |
|
) |
| |
Validates the given value. None of the values set in this ExcludedRule object must exist in the value that is given for validation to pass.
- 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. |
Implements PipServices3.Commons.Validate.IValidationRule.
The documentation for this class was generated from the following file:
- src/Validate/ExcludedRule.cs