Pip-Services-Commons-Dotnet
|
Validation rule that check that at exactly one of the object properties is not null. More...
Public Member Functions | |
OnlyOneExistsRule (params string[] properties) | |
Creates a new validation rule and sets its values More... | |
void | Validate (string path, Schema schema, object value, List< ValidationResult > results) |
Validates a given value against this rule. More... | |
Private Attributes | |
readonly string [] | _properties |
Validation rule that check that at exactly one of the object properties is not null.
See IValidationRule
PipServices3.Commons.Validate.OnlyOneExistsRule.OnlyOneExistsRule | ( | params string [] | properties | ) |
Creates a new validation rule and sets its values
properties | a list of property names where at only one property must exist |
void PipServices3.Commons.Validate.OnlyOneExistsRule.Validate | ( | string | path, |
Schema | schema, | ||
object | value, | ||
List< ValidationResult > | results | ||
) |
Validates a given value against this rule.
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.