问题
I have a class Partner and I use entlib5 validation block to validate class's fields (using data anottations). In one of method I read db table and create binding list of Partner's objects, but if there is an [IgnoreNull] annotation or [ValidationComposition]+[NotNullValidator] i get an System.NotSupportedException (for example: A validation attribute of type ValidatorCompositionAttribute cannot be used to validate values.)
If I use only [StringLengthValidator] there isn't any exception (but I need IgnoreNull or similar validator for some fields that can be leaved blank, or string must be within some range)
What is a problem?
来源:https://stackoverflow.com/questions/7776721/entlib5-validation-ignorenull-throws-exception-while-adding-objects-to-list