用于强制存储在 属性 类型字符串中的值实际上应该是一个数值的数据注释
Data annotation for enforcing that the value stored in a property of type string should actually be a numeric value
有没有注释可以让我说下面的属性必须有一个数值,然后我想为那个值指定一个范围?
[DataType.???]
[Range(1990, 2015)]
public string AnniversaryYear { get; set;}
我需要它是一个字符串是有原因的。
检查 Data Annotations Extensions that simply extends the data annotations that have into the framework, also look this article that show how to use them: Introducing Data Annotations Extensions
的使用情况
有没有注释可以让我说下面的属性必须有一个数值,然后我想为那个值指定一个范围?
[DataType.???]
[Range(1990, 2015)]
public string AnniversaryYear { get; set;}
我需要它是一个字符串是有原因的。
检查 Data Annotations Extensions that simply extends the data annotations that have into the framework, also look this article that show how to use them: Introducing Data Annotations Extensions
的使用情况