How to get BrokenRulesCollection?

How to get BrokenRulesCollection?

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


capiono posted on Tuesday, April 20, 2010

Hi,

I am new to CSLA, I have an abstract class with a definition of  business rule, now my problem is how do I get the Broken Rules from this abstract  class? 

JoeFallon1 replied on Saturday, April 24, 2010

In any class derived from it you have access to all the broken rules. Even rules that are set up in the abstract class. 

You should have an intermediate Base class which inherits from each CSLA type so that you can do custom work without altering CSLA. Then all your business objects inherit from your intermediate classes. This way you can add code to your base class which becomes available to all your BOs.

e.g.

Public Overrides ReadOnly Property BrokenRulesCollection() As Validation.BrokenRulesCollection
 
Get
   
Return MyBase.BrokenRulesCollection
  End Get
End Property

Joe

 

 

capiono replied on Tuesday, April 27, 2010

Thanks Joe, 

Should I write this method in the abstract class or class the derive from it? 

JoeFallon1 replied on Tuesday, April 27, 2010

I put it in the abstract class so that all BOs have it.

Joe

 

Copyright (c) Marimer LLC