Should IRuleContext methods take nullable parameters in CSLA 10? #4818
Replies: 1 comment 1 reply
-
|
Hi.
It's not checking for The actual problem is that ObjectRule is a If we change the parameter from In your case (and my in the future at work) is currently to use |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Now that nullable types are part of CSLA 10, and that BusinessRuleBase.PrimaryProperty is now nullable, does it make sense to make the method signatures on IRuleContext also take nullable parameters? Now that I've updated to 10, I'm getting hundreds of warnings within my rules that PrimaryProperty could be null. Here's an example of what I mean:
I'm getting warnings for all of my calls to Context.GetInputValue when I'm using PrimaryProperty. I would expect that GetInputValue would now take an IPropertyInfo? parameter now instead of just IPropertyInfo to avoid this warning, since it is checking for null anyway. I know that I can just pass in PrimaryProperty! or switch it up to use:
var ID = context.InputPropertyValues[PrimaryProperty];But I would think it would make less work for people if the method signatures now take those nullable types as well.
Beta Was this translation helpful? Give feedback.
All reactions