I'm converting a legacy app from using Microsoft.Practices.EnterpriseLibary.Validation to System.ComponentModel.DataAnnotations, and I'm trying to figure out how to implement an IgnoreNulls attribute. The old code has this:
[IgnoreNulls]
[StringLengthValidator(0, 255)]
public string Description { get; set; }
According to the documentation the StringLengthValidator will not get called if Description is assigned null. I'm trying to figure out how to do something similar. Is there a way to "short circuit" out of the validation chain or a way for the StringLengthValidator attribute to know that the IgnoreNulls attribute exists on the property?