Hashtable.comparer Property

Definition

Caution

Hashtable.comparer has been deprecated. Use the KeyComparer properties instead.

Caution

Please use KeyComparer properties.

Gets or sets the IComparer to use for the Hashtable.

C#
[System.Obsolete("Hashtable.comparer has been deprecated. Use the KeyComparer properties instead.")]
protected System.Collections.IComparer? comparer { get; set; }
C#
[System.Obsolete("Please use KeyComparer properties.")]
protected System.Collections.IComparer? comparer { get; set; }
C#
[System.Obsolete("Please use KeyComparer properties.")]
protected System.Collections.IComparer comparer { get; set; }
C#
protected System.Collections.IComparer comparer { get; set; }

Property Value

The IComparer to use for the Hashtable.

Attributes

Exceptions

The property is set to a value, but the hash table was created using an IEqualityComparer.

Remarks

Retrieving the value of this property is an O(1) operation.

Applies to

Product Versions (Obsolete)
.NET (Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10)
.NET Framework 1.1 (2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1)
.NET Standard (2.0, 2.1)

See also