Any rule which is "common" to various properties should be re-factored into a "common rules" class just like Rocky ships with CSLA. In fact I basically copied those rules (so I could also tweak them without editing CSLA itself) and then added more of my own. Now the rules are centralized and I can apply them to many BOs and many properties. In fact, I code gen most of the rules.
For a given BO it may have some rules which are specific to it. In those cases I use the strongly typed rule methods and write the rule in the BO itself. I then have access to all the member variables of the BO.
Finally there is AddDependentProperty which allows you to run the rules for another property if the first property is modified.
Joe
Yes. It is added to the Validation rules section, AddBusinessRules.
'when property1 is changed re-check the rules for Property2 and vice versa.'when property1 is changed re-check the rules for Property2 but NOT vice versa.
ValidationRules.AddDependantProperty("Property1", "Property2", False)
There is a spelling change in CSLA 3.5 from AddDependantProperty to AddDependentProperty. So use the "wrong" spelling in earlier versions and make the change once you upgrade to 3.5 You will get a compiler warning anyway about the old spelling being deprecated.
Joe
Copyright (c) Marimer LLC