DataAnnotation for checking if the integer is not a negative value

asp.net-mvc, asp.net-mvc-4

Solution

Does range work?

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

Problem

I have a `Quantity` column in my table in SQL Server 2008. But I want to write a data annotation in my asp.net mvc web application that checks if the entered value is greater than or equal to 1? So can anyone tell me which data annotation to use? Thanks

Original source