Suppose there is an object with an overridden GetHashCode , which I want to make a key. GetHashCode calculated as the collection of the GetHashCode of all fields.
I understand correctly that HashCode is calculated only 1 time when added to the dictionary?
Those. if during the life of a dictionary object, one of the key fields changes, then when you add a new object to the dictionary with the same fields, it will not notice duplicates?
Judging by the source code it is.
It turns out that for such cases you need to do your vocabulary implementation or is there something ready that HashCode recounts on the go?
GetHashCode. - andreycha