For reference types, the hash is based on an internal counter that is incremented every time a descendant of System.Object
is created. This happens in System.Object
's constructor.
For value types (struct
s), the hash is based on the first field. So if the first field is immutable, then you don't have to overload GetHashCode
for your type since the hash based on it will never change.
Source: Bill Wagner's Effective C# (first edition).
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.