BrokenRulesCollection empty when child invalid

BrokenRulesCollection empty when child invalid

Old forum URL: forums.lhotka.net/forums/t/5880.aspx


JoshL posted on Tuesday, November 25, 2008

If a managed child object is invalid, the parent's IsValid property returns false. However, the parent's BrokenRulesCollection is still empty. Is there a way to get a full set of broken rules, including the rules that are broken on the child objects? Or do I need to recursively walk the parent/child tree in order to find out why a given object is invalid?

JoeFallon1 replied on Tuesday, November 25, 2008

You have to recursively walk the tree.

I posted a sample a couple of years ago: (where does the time go??)

http://forums.lhotka.net/forums/thread/7444.aspx

Joe

JoshL replied on Wednesday, November 26, 2008

Thank-you. I'm doing something similar by recursively calling a "GetFullBrokenRulesCollection" that I implement on my base classes that inherit from CSLA.

However, it seems that this is something that CSLA should provide in order to be consistent with the new behavior of IsValid.

Copyright (c) Marimer LLC