invert if, how to explain .IsNotNull() should become .IsNull()

Hi,

I'm working with the Methode Extensions

myObject.IsNotNull() for myObject != null and

myObject.IsNull() for myObject == null

So, on doing "invert if statement to reduce nesting"
myObject.IsNotNull() becomes !myObject.IsNotNull()

That's obvious not really a beauty.

I'm shure there is a way to explain ReSharper that IsNotNull() is the invers of IsNull().
[Attribute...] ???

How does it work?

tia Ernst

1 comment
Comment actions Permalink

Hello Ernst
     I'm afraid at the moment there's no way to tell ReSharper that it should replace IsNotNull with IsNull while inverting if. Thank you!

Andrey Serebryansky

Senior Support Engineer

JetBrains, Inc

http://www.jetbrains.com

"Develop with pleasure!"

0

Please sign in to leave a comment.