ImmutableHashSet.ToImmutableHashSet 方法

定义

重载

ToImmutableHashSet<TSource>(IEnumerable<TSource>)

枚举序列,并生成其内容的不可变哈希集。

ToImmutableHashSet<TSource>(ImmutableHashSet<TSource>.Builder)

从生成器集的当前内容创建不可变哈希集。

ToImmutableHashSet<TSource>(IEnumerable<TSource>, IEqualityComparer<TSource>)

枚举序列,生成其内容的不可变哈希集,并为集类型使用指定的相等性比较器。

ToImmutableHashSet<TSource>(IEnumerable<TSource>)

枚举序列,并生成其内容的不可变哈希集。

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Immutable::ImmutableHashSet<TSource> ^ ToImmutableHashSet(System::Collections::Generic::IEnumerable<TSource> ^ source);
public static System.Collections.Immutable.ImmutableHashSet<TSource> ToImmutableHashSet<TSource> (this System.Collections.Generic.IEnumerable<TSource> source);
static member ToImmutableHashSet : seq<'Source> -> System.Collections.Immutable.ImmutableHashSet<'Source>
<Extension()>
Public Function ToImmutableHashSet(Of TSource) (source As IEnumerable(Of TSource)) As ImmutableHashSet(Of TSource)

类型参数

TSource

序列中元素的类型。

参数

source
IEnumerable<TSource>

要枚举的序列。

返回

ImmutableHashSet<TSource>

一个不可变哈希集,其中包含指定序列中的项。

适用于

ToImmutableHashSet<TSource>(ImmutableHashSet<TSource>.Builder)

从生成器集的当前内容创建不可变哈希集。

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Immutable::ImmutableHashSet<TSource> ^ ToImmutableHashSet(System::Collections::Immutable::ImmutableHashSet<TSource>::Builder ^ builder);
public static System.Collections.Immutable.ImmutableHashSet<TSource> ToImmutableHashSet<TSource> (this System.Collections.Immutable.ImmutableHashSet<TSource>.Builder builder);
static member ToImmutableHashSet : System.Collections.Immutable.ImmutableHashSet<'Source>.Builder -> System.Collections.Immutable.ImmutableHashSet<'Source>
<Extension()>
Public Function ToImmutableHashSet(Of TSource) (builder As ImmutableHashSet(Of TSource).Builder) As ImmutableHashSet(Of TSource)

类型参数

TSource

哈希集中元素的类型。

参数

builder
ImmutableHashSet<TSource>.Builder

要从中创建不可变哈希集的生成器。

返回

ImmutableHashSet<TSource>

包含生成器集中的当前内容的不可变哈希集。

适用于

ToImmutableHashSet<TSource>(IEnumerable<TSource>, IEqualityComparer<TSource>)

枚举序列,生成其内容的不可变哈希集,并为集类型使用指定的相等性比较器。

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Immutable::ImmutableHashSet<TSource> ^ ToImmutableHashSet(System::Collections::Generic::IEnumerable<TSource> ^ source, System::Collections::Generic::IEqualityComparer<TSource> ^ equalityComparer);
public static System.Collections.Immutable.ImmutableHashSet<TSource> ToImmutableHashSet<TSource> (this System.Collections.Generic.IEnumerable<TSource> source, System.Collections.Generic.IEqualityComparer<TSource> equalityComparer);
public static System.Collections.Immutable.ImmutableHashSet<TSource> ToImmutableHashSet<TSource> (this System.Collections.Generic.IEnumerable<TSource> source, System.Collections.Generic.IEqualityComparer<TSource>? equalityComparer);
static member ToImmutableHashSet : seq<'Source> * System.Collections.Generic.IEqualityComparer<'Source> -> System.Collections.Immutable.ImmutableHashSet<'Source>
<Extension()>
Public Function ToImmutableHashSet(Of TSource) (source As IEnumerable(Of TSource), equalityComparer As IEqualityComparer(Of TSource)) As ImmutableHashSet(Of TSource)

类型参数

TSource

序列中元素的类型。

参数

source
IEnumerable<TSource>

要枚举的序列。

equalityComparer
IEqualityComparer<TSource>

用于比较集内对象相等性的对象。

返回

ImmutableHashSet<TSource>

一个不可变哈希集,该集包含指定序列中的项,并使用指定的相等性比较器。

适用于