Extension Methods - IsNull and IsNotNull, good or bad use?
Posted
by Jaimal Chohan
on Stack Overflow
See other posts from Stack Overflow
or by Jaimal Chohan
Published on 2009-09-29T21:39:10Z
Indexed on
2010/03/28
11:03 UTC
Read the original article
Hit count: 300
I like readability.
So, I came up with an extension mothod a few minutes ago for the (x =! null) type syntax, called IsNotNull. Inversly, I also created a IsNull extension method, thus
if(x == null) becomes if(x.IsNull())
and
if(x != null) becomes if(x.IsNotNull())
However, I'm worried I might be abusing extension methods. Do you think that this is bad use of Extenion methods?
© Stack Overflow or respective owner