Beispiel #1
0
 public IEnumerable <ValidationResult> Validate(ValidationContext validationContext)
 {
     if (DOB.GetValueOrDefault() > DateTime.Today)
     {
         yield return(new ValidationResult("Date of Birth cannot be in the future.", new[] { "DOB" }));
     }
 }