I have a strange behavior on my c# code (asp.net code behind). I post here a screenshot of the watch window:

I have an object user that is null (as you can see) and the compare: user == null returns false. I don't understand why!
Is someone here that can explain why this happens?
Well you can easily write your own class which would give that result:
public class Evil
{
public static bool operator ==(Evil lhs, Evil rhs)
{
return false;
}
public static bool operator !=(Evil lhs, Evil rhs)
{
return false;
}
}
We're only guessing, at the moment... but that explains the symptoms.
(I've just tried overriding ToString, and I can't get the desired output.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With