548
99.9
Aug 08, 2011
Dennis, it seems you are a little confused as to how the Business Rules work in their framework. It is a little complicated, but it's not validating data from the database. It's validating data when it comes into the service layer from the presentation layer.
The way it works is, when a new business object is created, all the rules for that class populate a collection of rules, that then wait to be validated in the service layer.
When the object is passed into an Insert or Update method, for example, the Validate() method is called which iterates over the rules collection and compares the rule with the property value. If the rule passes, then it returns True, otherwise it returns False. Then it passes a message back up to the presentation layer.
If you look at the WCF service implementation class and go into any of the Set[class name] methods, you'll see the [object].Validate() method called in an IF statement. Inside the IF statement there's a FOREACH statement that iterates over the ValidateErrors collection. This is where the validation occurs.
I hope this helps clear this up.