ImmutableSortedDictionary.ToImmutableSortedDictionary 方法

定义

重载

ToImmutableSortedDictionary<TKey,TValue>(IEnumerable<KeyValuePair<TKey,TValue>>)

枚举键/值对的序列,并生成其内容的不可变排序字典。

ToImmutableSortedDictionary<TKey,TValue>(ImmutableSortedDictionary<TKey,TValue>.Builder)

从生成器字典的当前内容创建不可变排序字典。

ToImmutableSortedDictionary<TKey,TValue>(IEnumerable<KeyValuePair<TKey,TValue>>, IComparer<TKey>)

枚举键/值对的序列,并使用指定的键比较器生成其内容的不可变字典。

ToImmutableSortedDictionary<TKey,TValue>(IEnumerable<KeyValuePair<TKey,TValue>>, IComparer<TKey>, IEqualityComparer<TValue>)

枚举键/值对的序列,并使用指定的键和值比较器生成其内容的不可变排序字典。

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>)

枚举并转换序列,然后生成其内容的不可变排序字典。

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IComparer<TKey>)

枚举并转换序列,然后使用指定的键比较器生成其内容的不可变排序字典。

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IComparer<TKey>, IEqualityComparer<TValue>)

枚举并转换序列,然后使用指定的键和值比较器生成其内容的不可变排序字典。

ToImmutableSortedDictionary<TKey,TValue>(IEnumerable<KeyValuePair<TKey,TValue>>)

Source:
ImmutableSortedDictionary.cs
Source:
ImmutableSortedDictionary.cs
Source:
ImmutableSortedDictionary.cs

枚举键/值对的序列,并生成其内容的不可变排序字典。

C#
public static System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue> ToImmutableSortedDictionary<TKey,TValue> (this System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> source);

类型参数

TKey

字典中的键的类型。

TValue

字典中的值的类型。

参数

source
IEnumerable<KeyValuePair<TKey,TValue>>

要枚举的键/值对的序列。

返回

一个不可变排序字典,其中包含指定序列中的键/值对。

适用于

.NET 9 和其他版本
产品 版本
.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, 9
UWP 10.0

ToImmutableSortedDictionary<TKey,TValue>(ImmutableSortedDictionary<TKey,TValue>.Builder)

Source:
ImmutableSortedDictionary.cs
Source:
ImmutableSortedDictionary.cs
Source:
ImmutableSortedDictionary.cs

从生成器字典的当前内容创建不可变排序字典。

C#
public static System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue> ToImmutableSortedDictionary<TKey,TValue> (this System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue>.Builder builder);

类型参数

TKey

字典中的键的类型。

TValue

字典中的值的类型。

参数

builder
ImmutableSortedDictionary<TKey,TValue>.Builder

要从中创建不可变排序字典的生成器。

返回

包含生成器字典中当前内容的不可变排序字典。

适用于

.NET 9 和其他版本
产品 版本
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9

ToImmutableSortedDictionary<TKey,TValue>(IEnumerable<KeyValuePair<TKey,TValue>>, IComparer<TKey>)

Source:
ImmutableSortedDictionary.cs
Source:
ImmutableSortedDictionary.cs
Source:
ImmutableSortedDictionary.cs

枚举键/值对的序列,并使用指定的键比较器生成其内容的不可变字典。

C#
public static System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue> ToImmutableSortedDictionary<TKey,TValue> (this System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> source, System.Collections.Generic.IComparer<TKey> keyComparer);
C#
public static System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue> ToImmutableSortedDictionary<TKey,TValue> (this System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> source, System.Collections.Generic.IComparer<TKey>? keyComparer);

类型参数

TKey

字典中的键的类型。

TValue

字典中的值的类型。

参数

source
IEnumerable<KeyValuePair<TKey,TValue>>

要枚举的键/值对的序列。

keyComparer
IComparer<TKey>

生成不可变字典时要使用的键比较器。

返回

一个不可变排序字典,其中包含指定序列中的键/值对。

适用于

.NET 9 和其他版本
产品 版本
.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, 9
UWP 10.0

ToImmutableSortedDictionary<TKey,TValue>(IEnumerable<KeyValuePair<TKey,TValue>>, IComparer<TKey>, IEqualityComparer<TValue>)

Source:
ImmutableSortedDictionary.cs
Source:
ImmutableSortedDictionary.cs
Source:
ImmutableSortedDictionary.cs

枚举键/值对的序列,并使用指定的键和值比较器生成其内容的不可变排序字典。

C#
public static System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue> ToImmutableSortedDictionary<TKey,TValue> (this System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> source, System.Collections.Generic.IComparer<TKey> keyComparer, System.Collections.Generic.IEqualityComparer<TValue> valueComparer);
C#
public static System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue> ToImmutableSortedDictionary<TKey,TValue> (this System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>> source, System.Collections.Generic.IComparer<TKey>? keyComparer, System.Collections.Generic.IEqualityComparer<TValue>? valueComparer);

类型参数

TKey

字典中的键的类型。

TValue

字典中的值的类型。

参数

source
IEnumerable<KeyValuePair<TKey,TValue>>

要枚举的键/值对的序列。

keyComparer
IComparer<TKey>

生成不可变字典时要使用的键比较器。

valueComparer
IEqualityComparer<TValue>

用于不可变字典的值比较器。

返回

一个不可变排序字典,其中包含指定序列中的键/值对。

适用于

.NET 9 和其他版本
产品 版本
.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, 9
UWP 10.0

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>)

Source:
ImmutableSortedDictionary.cs
Source:
ImmutableSortedDictionary.cs
Source:
ImmutableSortedDictionary.cs

枚举并转换序列,然后生成其内容的不可变排序字典。

C#
public static System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue> ToImmutableSortedDictionary<TSource,TKey,TValue> (this System.Collections.Generic.IEnumerable<TSource> source, Func<TSource,TKey> keySelector, Func<TSource,TValue> elementSelector);

类型参数

TSource

序列中元素的类型。

TKey

生成的字典中键的类型。

TValue

生成的字典中值的类型。

参数

source
IEnumerable<TSource>

为生成字典而要枚举的序列。

keySelector
Func<TSource,TKey>

用于从每个序列元素生成字典键的函数。

elementSelector
Func<TSource,TValue>

用于从每个序列元素生成字典值的函数。

返回

一个不可变排序字典,其中包含指定序列中的项。

适用于

.NET 9 和其他版本
产品 版本
.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, 9
UWP 10.0

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IComparer<TKey>)

Source:
ImmutableSortedDictionary.cs
Source:
ImmutableSortedDictionary.cs
Source:
ImmutableSortedDictionary.cs

枚举并转换序列,然后使用指定的键比较器生成其内容的不可变排序字典。

C#
public static System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue> ToImmutableSortedDictionary<TSource,TKey,TValue> (this System.Collections.Generic.IEnumerable<TSource> source, Func<TSource,TKey> keySelector, Func<TSource,TValue> elementSelector, System.Collections.Generic.IComparer<TKey> keyComparer);
C#
public static System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue> ToImmutableSortedDictionary<TSource,TKey,TValue> (this System.Collections.Generic.IEnumerable<TSource> source, Func<TSource,TKey> keySelector, Func<TSource,TValue> elementSelector, System.Collections.Generic.IComparer<TKey>? keyComparer);

类型参数

TSource

序列中元素的类型。

TKey

生成的字典中键的类型。

TValue

生成的字典中值的类型。

参数

source
IEnumerable<TSource>

为生成字典而要枚举的序列。

keySelector
Func<TSource,TKey>

用于从每个序列元素生成字典键的函数。

elementSelector
Func<TSource,TValue>

用于从每个序列元素生成字典值的函数。

keyComparer
IComparer<TKey>

用于字典的键比较器。

返回

一个不可变字典,其中包含指定序列中的项。

适用于

.NET 9 和其他版本
产品 版本
.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, 9
UWP 10.0

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IComparer<TKey>, IEqualityComparer<TValue>)

Source:
ImmutableSortedDictionary.cs
Source:
ImmutableSortedDictionary.cs
Source:
ImmutableSortedDictionary.cs

枚举并转换序列,然后使用指定的键和值比较器生成其内容的不可变排序字典。

C#
public static System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue> ToImmutableSortedDictionary<TSource,TKey,TValue> (this System.Collections.Generic.IEnumerable<TSource> source, Func<TSource,TKey> keySelector, Func<TSource,TValue> elementSelector, System.Collections.Generic.IComparer<TKey> keyComparer, System.Collections.Generic.IEqualityComparer<TValue> valueComparer);
C#
public static System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue> ToImmutableSortedDictionary<TSource,TKey,TValue> (this System.Collections.Generic.IEnumerable<TSource> source, Func<TSource,TKey> keySelector, Func<TSource,TValue> elementSelector, System.Collections.Generic.IComparer<TKey>? keyComparer, System.Collections.Generic.IEqualityComparer<TValue>? valueComparer);

类型参数

TSource

序列中元素的类型。

TKey

生成的字典中键的类型。

TValue

生成的字典中值的类型。

参数

source
IEnumerable<TSource>

为生成字典而要枚举的序列。

keySelector
Func<TSource,TKey>

用于从每个序列元素生成字典键的函数。

elementSelector
Func<TSource,TValue>

用于从每个序列元素生成字典值的函数。

keyComparer
IComparer<TKey>

用于字典的键比较器。

valueComparer
IEqualityComparer<TValue>

用于字典的值比较器。

返回

一个不可变排序字典,其中包含指定序列中的项。

适用于

.NET 9 和其他版本
产品 版本
.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, 9
UWP 10.0