VAB Self Validation and Integration

Topics: Validation Application Block
Aug 16, 2007 at 7:20 PM
Hi,

I need to validate some property that require the whole object to perform the validation. I guess it has to be done with the Self Node (im using config file to set my validation rule). Thats what im trying to do. But I dont understand with a Self Validation how I can set an error message to a specific object property so it could be use by the ProxyPropertyValidator associated with the property.

Secondly, I would appreciate if I could get some information about how to use more than 1 validation method in a Self Validation file (Can I use the self validation with something else than a CustomValidator?). Again im using the config file.

Thank you!
Aug 17, 2007 at 1:46 AM
Hi,

"Self Validation" and the "Self node" in the cofiguration file are two different things. Validators under the self node are equivalent to attributes at the type level, while self validation is only supported by attributes and works by invoking a method with custom validation logic (which is also different from having a custom validator).

I'm not sure what you mean by validating a property that requires the whole object to perform validation. Which object would that be, the one referenced by the property? Anyway, the only way to indicate custom validation through configuration is to provide a custom validator class. Also, proper "self validation" is not supported in the integration scenarios because the validations defined for a type are not used for instances of the type, so invoking a method on the target type would not make sense.

Regards,
Fernando
Aug 17, 2007 at 2:32 AM
Ok I see, well I was completely lost! thanks for the information.