You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This type of validator would accept a sequence of values (the sequence). The implementation would scan the sequence and throw an exception if any element in the sequence evaluates to the value represented by the validator.
NotIn(params T[])
This type of validator would accept a sequence of values (the sequence). The implementation would scan the sequence and throw an exception if no element in the sequence evaluates to the value represented by the validator.
Justification:
This eliminates the need for verbose checks such as x == 1 || x == 3 || x == 17 || x == 21 and reduces them to x.In(1, 3, 17, 21), while x.NotIn(1, 3, 17, 21) is the natural reduction of x != 1 && x != 3 && x != 17 && x != 21.
This type of validation is appropriate for all comparable types (string, and all the numeric data types) and all Enum types.
The text was updated successfully, but these errors were encountered:
In(params T[])
This type of validator would accept a sequence of values (the sequence). The implementation would scan the sequence and throw an exception if any element in the sequence evaluates to the value represented by the validator.
NotIn(params T[])
This type of validator would accept a sequence of values (the sequence). The implementation would scan the sequence and throw an exception if no element in the sequence evaluates to the value represented by the validator.
Justification:
This eliminates the need for verbose checks such as
x == 1 || x == 3 || x == 17 || x == 21
and reduces them tox.In(1, 3, 17, 21)
, whilex.NotIn(1, 3, 17, 21)
is the natural reduction ofx != 1 && x != 3 && x != 17 && x != 21
.This type of validation is appropriate for all comparable types (
string
, and all the numeric data types) and allEnum
types.The text was updated successfully, but these errors were encountered: