Asp.net mvc 用于检查整数是否不是负值的DataAnnotation

Asp.net mvc 用于检查整数是否不是负值的DataAnnotation,asp.net-mvc,asp.net-mvc-4,Asp.net Mvc,Asp.net Mvc 4,在SQLServer2008中,我的表中有一个Quantity列。但是我想在我的asp.net mvc web应用程序中编写一个数据注释,检查输入的值是否大于或等于1?那么,有人能告诉我使用哪种数据注释吗 谢谢这行吗 [Range(1, Int32.MaxValue, ErrorMessage = "Value should be greater than or equal to 1")]

在SQLServer2008中,我的表中有一个
Quantity
列。但是我想在我的asp.net mvc web应用程序中编写一个数据注释,检查输入的值是否大于或等于1?那么,有人能告诉我使用哪种数据注释吗

谢谢这行吗

[Range(1, Int32.MaxValue, ErrorMessage = "Value should be greater than or equal to 1")]