How does IgnoreNulls ValidationAttribute affect other attributes Microsoft.Practices.EnterpriseLibrary.Validation

41 views Asked by At

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?

0

There are 0 answers