CSLA0017 - Should it check for Add() Methods in Called Methods within Execute? #2616
Unanswered
mtavares628
asked this question in
Questions
Replies: 1 comment 2 replies
-
I suggest relaxing the analyzer in that file by using a #pragma |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
My code is triggering a bunch of warnings for analyzer CSLA0017 because I am calling the Add() methods from another method being called within Execute. My scenario for doing this is as follows:
My business object processes some rules differently based on a closing date field, where if there is a closing date then, my business rules should run with error severity, but otherwise the rules should run with warning severity. To set this up, I've created a chained rule that checks this field, and based on whether it is empty or not, it calls the same dependent rule, but passing in the severity when adding the rule. Then, I created a subclass of CommonBusinessRule that has a function that sets the context Add() method based on the severity.
So my Execute looks like this:
And the SetContext looks like this:
So my question is, should the analyzer be adjusted to check for those Add() methods in any called sub-methods, or should I just be relaxing that analyzer in my project?
Beta Was this translation helpful? Give feedback.
All reactions