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
For value types (
structs), 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).