Прочетете на английски Редактиране

Споделяне чрез


ImmutableDictionary<TKey,TValue>.WithComparers Method

Definition

Overloads

WithComparers(IEqualityComparer<TKey>)

Gets an instance of the immutable dictionary that uses the specified key comparer.

WithComparers(IEqualityComparer<TKey>, IEqualityComparer<TValue>)

Gets an instance of the immutable dictionary that uses the specified key and value comparers.

WithComparers(IEqualityComparer<TKey>)

Source:
ImmutableDictionary_2.cs
Source:
ImmutableDictionary_2.cs
Source:
ImmutableDictionary_2.cs
Source:
ImmutableDictionary_2.cs

Gets an instance of the immutable dictionary that uses the specified key comparer.

C#
public System.Collections.Immutable.ImmutableDictionary<TKey,TValue> WithComparers(System.Collections.Generic.IEqualityComparer<TKey> keyComparer);
C#
public System.Collections.Immutable.ImmutableDictionary<TKey,TValue> WithComparers(System.Collections.Generic.IEqualityComparer<TKey>? keyComparer);

Parameters

keyComparer
IEqualityComparer<TKey>

The key comparer to use.

Returns

An instance of the immutable dictionary that uses the given comparer.

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)
UWP 10.0

WithComparers(IEqualityComparer<TKey>, IEqualityComparer<TValue>)

Source:
ImmutableDictionary_2.cs
Source:
ImmutableDictionary_2.cs
Source:
ImmutableDictionary_2.cs
Source:
ImmutableDictionary_2.cs

Gets an instance of the immutable dictionary that uses the specified key and value comparers.

C#
public System.Collections.Immutable.ImmutableDictionary<TKey,TValue> WithComparers(System.Collections.Generic.IEqualityComparer<TKey> keyComparer, System.Collections.Generic.IEqualityComparer<TValue> valueComparer);
C#
public System.Collections.Immutable.ImmutableDictionary<TKey,TValue> WithComparers(System.Collections.Generic.IEqualityComparer<TKey>? keyComparer, System.Collections.Generic.IEqualityComparer<TValue>? valueComparer);

Parameters

keyComparer
IEqualityComparer<TKey>

The key comparer to use.

valueComparer
IEqualityComparer<TValue>

The value comparer to use.

Returns

An instance of the immutable dictionary that uses the given comparers.

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)
UWP 10.0