Validator Order Contract

Topics: Validation Application Block
Sep 16, 2007 at 6:35 PM
What can we assume regarding the order on which the validators are composed?

  1. Type then Properties, Fields, Methods and SelfValidation?
  2. Order of the validator data nodes in the config file?
  3. Order of the validator attribute declaration?

I am looking to develop a validator using attributes and I would like to make sure it is the 1st one being executed.

Would it be a better idea to support an Order value on the IValidatorDescriptor in a future version?

Sep 17, 2007 at 4:15 PM
Hi Francois,

Supporting an Order property is the only way to go to ensure a certain validator gets executed first, as the order in which custom attributes are retrieved cannot be relied on.