Validate all properties regardless of Ruleset name

Topics: Validation Application Block
Jun 7, 2010 at 7:50 AM

I've got a DTO that has 6 properties. These properties are split across 2 rulesets (correspond to the screen that the data is entered). Now I run the validation for the rulesets fine (i.e., when the user navigates between pages). However, on my business applicatin tier I want to validate the 'whole' object regardless of ruleset name. So the question is can I create a validator that validates all properties and ignores the ruleset name if supplied ny the validator meta-data.

Jun 7, 2010 at 8:02 AM

There's no direct way to do it.  You could get the list of rulesets from the config and make use of Validation.Validate method which takes any number of rulesets you want.  However, there's no overload of the CreateValidator method which take such parameter so you would need to call it for each ruleset.

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@Avanade.com