1

我正在使用 WCF RIA 服务。我面临 DateTime 字段的 RangeAttribute 需求。RangeAttribute 是否支持 DateTime 字段?还是我需要应用自己的 CustomAttribute?

4

1 回答 1

1

我找到了答案。可以像这样对 DateTime 使用 Range 属性:

[Range(typeof(DateTime), "1-Jan-1910", "1-Jan-2060", ErrorMessage = "Неверный формат даты")]
public virtual System.DateTime IssueDate
于 2013-07-15T13:04:27.840 回答