This is what I could come up with to check for null equality. It works but it is Shreak looking. The following is valid for this example:
x != null and y == null returns false;
x == null and y != null returns false;
x == null and y == null returns true;
x.ToString() == y.ToString() returns true;
I guess I could code the above but I still feel there is a cleaner way to solve it.
public bool Equals(ConvertibleData x, ConvertibleData y)
{
if (x == null)
{
if (y == null)
{
return true;
}
return false;
}
if (y == null)
{
return false;
}
return x.ToString() == y.ToString(); //Disregard the ToString, this coult be any comparer validation
}