ImmutableSortedDictionary<TKey,TValue>.WithComparers Method

Definition

Overloads

WithComparers(IComparer<TKey>)

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

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

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

WithComparers(IComparer<TKey>)

Source:
ImmutableSortedDictionary_2.cs
Source:
ImmutableSortedDictionary_2.cs
Source:
ImmutableSortedDictionary_2.cs
Source:
ImmutableSortedDictionary_2.cs

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

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

Parameters

keyComparer
IComparer<TKey>

The key comparer to use.

Returns

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

Applies to

.NET 10 and other versions
Product Versions
.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(IComparer<TKey>, IEqualityComparer<TValue>)

Source:
ImmutableSortedDictionary_2.cs
Source:
ImmutableSortedDictionary_2.cs
Source:
ImmutableSortedDictionary_2.cs
Source:
ImmutableSortedDictionary_2.cs

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

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

Parameters

keyComparer
IComparer<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 and other versions
Product Versions
.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