GetHashCode
is implemented on your TKey
type, not on the Dictionary
class.
For int.GetHashCode()
, which your example uses, it's defined as:
public override int GetHashCode()
{
return this;
}
Number of backets has nothing to do with the hashcode value.