An IDictionary where keys are compared by object identity, rather than equals. All external users of this class need to have no knowledge of the IdentityKey - it is all hidden by this class.

Namespace:  NHibernate.Util
Assembly:  NHibernate (in NHibernate.dll)

Syntax

Visual Basic (Declaration)
<SerializableAttribute> _
Public NotInheritable Class IdentityMap _
	Implements IDictionary, ICollection, IEnumerable
C#
[SerializableAttribute]
public sealed class IdentityMap : IDictionary, 
	ICollection, IEnumerable
Visual C++
[SerializableAttribute]
public ref class IdentityMap sealed : IDictionary, 
	ICollection, IEnumerable
JavaScript
NHibernate.Util.IdentityMap = function();

Type.createClass(
	'NHibernate.Util.IdentityMap',
	null,
	IDictionary,
	ICollection,
	IEnumerable);

Remarks

Do NOT use a System.Value type as the key for this Hashtable - only classes. See the google thread about why using System.Value is a bad thing.

If I understand it correctly, the first call to get an object defined by a DateTime("2003-01-01") would box the DateTime and return the identity key for the box. If you were to get that Key and unbox it into a DateTime struct, then the next time you passed it in as the Key the IdentityMap would box it again (into a different box) and it would have a different IdentityKey - so you would not get the same value for the same DateTime value.

Inheritance Hierarchy

System..::.Object
  NHibernate.Util..::.IdentityMap

See Also