RuleContext - Missing overload?

RuleContext - Missing overload?

Old forum URL:

ajj3085 posted on Sunday, October 09, 2011

I'm trying to implement a rule in Csla 4.1.0 that, when broken, will stop processing. However, there doesn't appear to be an overload that takes the property, description and the flag to stop processing. Am I missing something?

JonnyBee replied on Sunday, October 09, 2011

In Csla 4.1 you should only use the

    public void AddErrorResult(string description, bool stopProcessing)   or
    public void AddErrorResult(string description)

and similar overloads for AddXYZResult.

The BusinessRules class has several issues in 4.1 with adding error/warning/info to other properties than PrimaryProperty. These have been fixed for CSLA 4.2.

The important part is - your property level rules must have a PrimaryProperty and should only use the AddXYZResult that do NOT take an IPropertyInfo as parameter (at least until you move up to Csla 4.2).








ajj3085 replied on Sunday, October 09, 2011

Oh, I didn't even notice those. Thanks, that solves the problem. Rocky, it may be worthwhile to point out in the Using Csla 4 Objects eBook to prefer the methods which don't take an IPropertyInfo. 

Copyright (c) Marimer LLC