【发布时间】:2014-07-14 10:50:41
【问题描述】:
我正在寻找一个带有两个参数依赖属性和运算符的数据注释(例如:>、
[Compare('DependendentProperty', '<')]
如果我们有任何支持类似功能的现有数据注释,请提出建议。
【问题讨论】:
-
我认为您必须为此创建一个自定义 ValidationAttribute,看看这个:http://cncrrnt.com/blog/index.php/2011/01/custom-validationattribute-for-comparing-properties/
-
谢谢马克!这有帮助。
标签: c# .net asp.net-mvc data-annotations