Ανάγνωση στα Αγγλικά Επεξεργασία

Κοινή χρήση μέσω


HashCode.Add Method

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

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 10 και άλλες εκδόσεις
Προϊόν Εκδόσεις
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.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 10 και άλλες εκδόσεις
Προϊόν Εκδόσεις
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.0 (package-provided), 2.1