It's been a while since I posted but it's never too late to get back in the game :)
A developer in my team has a use case that requires a business rules to be dependant on another business rule. We are using CSLA 2.0.
Business Rule A
Business Rule B (is dependant on A)
Business Rule C (is dependant on A)
Business Rule D
In this example Business Rule B and C and dependant on A in that A, B, and C has to give the green light for A as a whole to have a green light. If A is not met, then B and C must NOT be executed. D on the other hand will always be executed.
Any way we can accomodate this use case with CSLA 2.0
Much appreciated
Umm... already thought about that, I was hoping for a solution that did not tightly coupled the dependant business rules by encapsulating them in if statements.
I probably chasing a ghost here :)
CSLA 3.0 can do shortcircuiting. Basically you can keep other rules from running for the same property. This isn't exactly what you want but it will probably get you close. I'm not sure how you control the rule order (perhaps it is just the order you add then to the validationrules collection).
Inside of the rule:
e.StopProcessing = true;
Copyright (c) Marimer LLC