Recently I have asked a question about GetHashCode GetHashCode for the object with several data members
After checking http://msdn.microsoft.com/en-us/library/ms132155(v=vs.110).aspx, looks that if the input for GetHashCode is null the exception should be thrown.
Is it correct ?looks that the correct implementation should be :
public int GetHashCode(MyClass myobj)
{
if(myObj == null)
{
//Throw exception ?
//return base.GetHashCode(); <-- not correct?
}
return (myObj.x != null ? myObj.x.GetGashCode() : 0) ^ (myObj.y != null ? myObj.y.GetGashCode()
}