π’Number
Common validations to number types
InclusiveBetween Validator
Ensures that the number is within the specified range, including both limits.
Example:
builder.OfInt().For("Age").InclusiveBetween(18, 120);Example error: 'Age' must be between 18 and 120, including both limits.
String format args:
Name: Name of the type being validatedValue: Current value of the propertyMin: Minimum value of the rangeMax: Maximum value of the range
ExclusiveBetween Validator
Ensures that the number is within the specified range, excluding both limits.
Example:
builder.OfInt().For("Age").ExclusiveBetween(18, 120);Example error: 'Age' must be between 18 and 120, excluding both limits.
String format args:
Name: Name of the type being validatedValue: Current value of the propertyMin: Minimum value of the rangeMax: Maximum value of the range
Last updated