Enumerable.ToHashSet Yöntem

Tanım

Aşırı Yüklemeler

ToHashSet<TSource>(IEnumerable<TSource>)

bir içinden bir HashSet<T>IEnumerable<T>oluşturur.

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

anahtarları karşılaştırmak comparer için kullanarak içinden bir HashSet<T>IEnumerable<T> oluşturur.

ToHashSet<TSource>(IEnumerable<TSource>)

Kaynak:
ToCollection.cs
Kaynak:
ToCollection.cs
Kaynak:
ToCollection.cs

bir içinden bir HashSet<T>IEnumerable<T>oluşturur.

C#
public static System.Collections.Generic.HashSet<TSource> ToHashSet<TSource> (this System.Collections.Generic.IEnumerable<TSource> source);

Tür Parametreleri

TSource

öğelerinin sourcetürü.

Parametreler

source
IEnumerable<TSource>

Kaynak IEnumerable<T> oluşturmak için bir HashSet<T> .

Döndürülenler

HashSet<TSource>

HashSet<T> Giriş dizisinden seçilen türdeki TSource değerleri içeren bir.

Özel durumlar

source, null değeridir.

Ayrıca bkz.

Şunlara uygulanır

.NET 9 ve diğer sürümler
Ürün Sürümler
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.7.2, 4.8, 4.8.1
.NET Standard 2.1

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

Kaynak:
ToCollection.cs
Kaynak:
ToCollection.cs
Kaynak:
ToCollection.cs

anahtarları karşılaştırmak comparer için kullanarak içinden bir HashSet<T>IEnumerable<T> oluşturur.

C#
public static System.Collections.Generic.HashSet<TSource> ToHashSet<TSource> (this System.Collections.Generic.IEnumerable<TSource> source, System.Collections.Generic.IEqualityComparer<TSource>? comparer);
C#
public static System.Collections.Generic.HashSet<TSource> ToHashSet<TSource> (this System.Collections.Generic.IEnumerable<TSource> source, System.Collections.Generic.IEqualityComparer<TSource> comparer);

Tür Parametreleri

TSource

öğelerinin sourcetürü.

Parametreler

source
IEnumerable<TSource>

Kaynak IEnumerable<T> oluşturmak için bir HashSet<T> .

comparer
IEqualityComparer<TSource>

Anahtarları karşılaştırmak için bir IEqualityComparer<T> .

Döndürülenler

HashSet<TSource>

HashSet<T> Giriş dizisinden seçilen türdeki TSource değerleri içeren bir.

Özel durumlar

source, null değeridir.

Ayrıca bkz.

Şunlara uygulanır

.NET 9 ve diğer sürümler
Ürün Sürümler
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.7.2, 4.8, 4.8.1
.NET Standard 2.1