属性路由参数约束

来源:互联网 发布:侯喜王歌 知乎 编辑:程序博客网 时间:2024/05/22 02:02
参考:点击打开链接

ConstraintDescriptionExamplealphaMatches uppercase or lowercase Latin alphabet characters (a-z, A-Z){x:alpha}boolMatches a Boolean value.{x:bool}datetimeMatches a DateTime value.{x:datetime}decimalMatches a decimal value.{x:decimal}doubleMatches a 64-bit floating-point value.{x:double}floatMatches a 32-bit floating-point value.{x:float}guidMatches a GUID value.{x:guid}intMatches a 32-bit integer value.{x:int}lengthMatches a string with the specified length or within a specified range of lengths.{x:length(6)}
{x:length(1,20)}longMatches a 64-bit integer value.{x:long}maxMatches an integer with a maximum value.{x:max(10)}maxlengthMatches a string with a maximum length.{x:maxlength(10)}minMatches an integer with a minimum value.{x:min(10)}minlengthMatches a string with a minimum length.{x:minlength(10)}rangeMatches an integer within a range of values.{x:range(10,50)}regexMatches a regular expression.{x:regex(^\d{3}-\d{3}-\d{4}$)}
0 0
原创粉丝点击