What is a better way for checking nulls than using the "==" operator?
For example, .Equals() is better than == for most operations since it
knows the type being checked. However, it doesn't seem to work for
nulls. For example:
object myobject = new object();
myobject = null;
if (myobject.Equals(null))
Debug.WriteLine("no go");
For some reason, I get stuck on the if statement when debugging.
Stepping over just keeps me on the if line. Any suggestions?
Thanks,
Brett