Does C# dictionary store only the reference of the object or the full copy of the object which is added as key?
问题 I want to use a class as key for a dictionary. But the class is large in terms of memory consumption. So, I want to know that when we add an object as key to dictionary, does it only add its reference or full copy is added. As, if the full copy of the object is added then I can just use the hashcode of the object. 回答1: The dictionary stores whatever value is passed in - that's the case for both the key and the value of the entry. For reference types, that value is a reference - there's no