HashCode.Add Method

Definition

Overloads

Add<T>(T)

Adds a single value to the hash code.

Add<T>(T, IEqualityComparer<T>)

Adds a single value to the hash code, specifying the type that provides the hash code function.

Add<T>(T)

Source:
HashCode.cs
Source:
HashCode.cs
Source:
HashCode.cs

Adds a single value to the hash code.

public void Add<T> (T value);

Type Parameters

T

The type of the value to add to the hash code.

Parameters

value
T

The value to add to the hash code.

Applies to

.NET 9 i druge verzije
Proizvod Verzije
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Standard 2.0 (package-provided), 2.1

Add<T>(T, IEqualityComparer<T>)

Source:
HashCode.cs
Source:
HashCode.cs
Source:
HashCode.cs

Adds a single value to the hash code, specifying the type that provides the hash code function.

public void Add<T> (T value, System.Collections.Generic.IEqualityComparer<T>? comparer);
public void Add<T> (T value, System.Collections.Generic.IEqualityComparer<T> comparer);

Type Parameters

T

The type of the value to add to the hash code.

Parameters

value
T

The value to add to the hash code.

comparer
IEqualityComparer<T>

The IEqualityComparer<T> to use to calculate the hash code. This value can be a null reference (Nothing in Visual Basic), which will use the default equality comparer for T.

Applies to

.NET 9 i druge verzije
Proizvod Verzije
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Standard 2.0 (package-provided), 2.1