ghuntley / conditions

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

Closed SurajGupta closed 7 years ago

SurajGupta commented 9 years ago

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)

SurajGupta commented 9 years ago

@ghuntley - any thoughts on this?

ghuntley commented 9 years ago

No experience w/ this matter. I too would be hesitant to turn off the FXCop rule as well.

SurajGupta commented 7 years ago

I don't think this is doable. closing.