1
我正在使用WCF RIA Services。我面臨需要DateTime字段的RangeAttribute。 RangeAttribute是否支持DateTime字段?或者我需要應用自己的CustomAttribute?DateTime字段的RangeAttribute
我正在使用WCF RIA Services。我面臨需要DateTime字段的RangeAttribute。 RangeAttribute是否支持DateTime字段?或者我需要應用自己的CustomAttribute?DateTime字段的RangeAttribute
我找到了答案。有可能使用Range attrubute來處理DateTime,如下所示:
[Range(typeof(DateTime), "1-Jan-1910", "1-Jan-2060", ErrorMessage = "Неверный формат даты")]
public virtual System.DateTime IssueDate