🔢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 validated

  • Value: Current value of the property

  • Min: Minimum value of the range

  • Max: 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 validated

  • Value: Current value of the property

  • Min: Minimum value of the range

  • Max: Maximum value of the range

Last updated