I'm enjoying my foray into CSLA 4.
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.
I thought I saw templates for CSLA 4 somewhere but now I cannot find them. Can I get a head's up?
Typically you'd put this rule into the parent object containing the collection, and trigger it to run in OnChildChanged.
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