CSLA 4: Collection Rules | Templates

CSLA 4: Collection Rules | Templates

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


mehgerbil posted on Monday, November 29, 2010

I'm enjoying my foray into CSLA 4.

#1

Question: What is a good strategy for handling a collection rule.  That is, a rule that is based upon the characteristics (totals) of an entire collection.  For example, I've a collection that represents a list of percentages that may be applied as payments on a debt but the total of the percentages in the payments collection should never be more than 100%.

Payment 1: 20%, Payment 2: 30%, Payment 3: 70%

In that example, we'd have a total of 120% which should make the collection invalid.  It seems that it may be handled in the parent object but I don't know if that is supported or not.

 

#2

I thought I saw templates for CSLA 4 somewhere but now I cannot find them.  Can I get a head's up?

RockfordLhotka replied on Monday, November 29, 2010

#1

Typically you'd put this rule into the parent object containing the collection, and trigger it to run in OnChildChanged.

#2

Look in the Support folder, where you'll find snippets and "templates". There are no actual Visual Studio templates for CSLA 4. We had some for 3.x, but it turns out to be really hard to maintain the vsix installer and the volunteer who was working on that hasn't had the time to keep it up to date.

Copyright (c) Marimer LLC