I was watching a video where we override GetHashCode
method like this:
public override GetHashCode()
{
return this.Name.GetHashCode() ^ this.Id.GetHashCode();
}
Why did we do that here to get the new HashCode
? so why XOR
operator between those two variables?
Here is the video:
https://youtu.be/XIbBfmsVzpg?list=PL6n9fhu94yhWi8K02Eqxp3Xyh_OmQ0Rp6
Time 9:55