If you are just starting out on a new project I recommend using https://github.com/adamralph/liteguard instead of conditions. Especially if using in a mobile application, less allocations and better performance. This project is deprecated and needs a new maintainer. Contact me if you want to take over.
MIT License
56
stars
10
forks
source link
Code Analysis warns when checking arguments on public methods using Conditions #2
I'm running Code Analysis (formerly FXCop) on a project and I'm getting CA1062: Validate arguments of public methods It seems that Code Analysis does not respect a call like:
Condition.Requires(myParam, "myParam").IsNotNull()
It thinks I am not checking for null when in fact I am, using Conditions.
I'm wondering if a fully in-lined version of Conditions would make this go away? Any experience on this matter? Some kind of known workaround (besides for turning off the rule, which I'm hesitant to do)
I'm running Code Analysis (formerly FXCop) on a project and I'm getting
CA1062: Validate arguments of public methods
It seems that Code Analysis does not respect a call like:Condition.Requires(myParam, "myParam").IsNotNull()
It thinks I am not checking for null when in fact I am, using Conditions.
I'm wondering if a fully in-lined version of Conditions would make this go away? Any experience on this matter? Some kind of known workaround (besides for turning off the rule, which I'm hesitant to do)