Constraint Routing

Constraint
Constraint Description Expression Example
alpha Matches uppercase or lowercase Latin alphabet characters (a-z, A-Z) {x:alpha} Success Failure
bool Matches a Boolean value. {x:bool} Success Failure
datetime Matches a DateTime value. {x:datetime} Success Failure
datetime Matches a DateTime value with a custom format. {x:datetime(yyyy-MM-dd)} Success Failure
decimal Matches a decimal value. {x:decimal} Success Failure
guid Matches a GUID value. {x:guid} Success Failure
int Matches a integer value. {x:int} Success Failure
length Matches a string with the specified length or within a specified range of lengths. {x:length(6)}
{x:length(1,20)}
Success Failure
max Matches an integer with a maximum value. {x:max(6)} Success Failure
maxlength Matches a string with a maximum length. {x:maxlength(10)} Success Failure
min Matches an integer with a minimum value. {x:min(4)} Success Failure
minlength Matches a string with a minimum length. {x:minlength(4)} Success Failure
range Matches an integer within a range of values. {x:range(10,20)} Success Failure
version Matches a version number. {x:version} Success Failure
email Matches an e-mail address (according to @jchannon). {x:email} Success Failure