I wanted to know if I have validate whether the inserted date is larger or not than the current date using Annotation, or if I have to handle the same controller. If so, please provide an example.
I wanted to know if I have validate whether the inserted date is larger or not than the current date using Annotation, or if I have to handle the same controller. If so, please provide an example.
You can do this by creating a class that is derived from RangeAttribute
:
public class DateAttribute : RangeAttribute
{
public DateAttribute()
: base(typeof(DateTime), DateTime.Now.ToShortDateString(), DateTime.MaxValue.ToShortDateString()) { }
}