Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 WCF RIA 服务。我面临 DateTime 字段的 RangeAttribute 需求。RangeAttribute 是否支持 DateTime 字段?还是我需要应用自己的 CustomAttribute?
我找到了答案。可以像这样对 DateTime 使用 Range 属性:
[Range(typeof(DateTime), "1-Jan-1910", "1-Jan-2060", ErrorMessage = "Неверный формат даты")] public virtual System.DateTime IssueDate