Question

I'm using WCF RIA Services. I'm faced with need of RangeAttribute for DateTime field. Does RangeAttribute supports DateTime fields? Or do i need to apply own CustomAttribute?

Était-ce utile?

La solution

I've found an answer. It's possible to use Range attrubute for DateTime like this:

[Range(typeof(DateTime), "1-Jan-1910", "1-Jan-2060", ErrorMessage = "Неверный формат даты")]
public virtual System.DateTime IssueDate
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top