Quantcast
Viewing all articles
Browse latest Browse all 764

How to trigger validation rules between child objects.

What would you do in this situation?

Parent A

 Child B

  Property B1

 Child C

  Property C2

Basically, there is a parent business object, with two child business objects, each with a property.

Now, what I need is to have a validation rule on Child B Property B1, that checks if the value in Child C Property C2 is the same.  

So this would need to be triggered whenever either Child B Property B1 changes, or Child C Property C2 changes.

I don't want Child B to have to know about the existence of Child C, or vice-versa.

This is a cut down example of a real-world issue, which is far more complex, but finding a simple approach to this should apply for the more complex.

BTW, it's impractical for me to have a replica of Child B Property B1 and/or Child C Property C2 on Parent A.

And I am quite ok to use multiple rules, and to trigger them from OnChildChanged, if that makes it easier.

I'm using CSLA 4.3.

I'm open to any suggestions.


Viewing all articles
Browse latest Browse all 764

Trending Articles