Enumerable.ToHashSet Metoda

Definicja

Przeciążenia

ToHashSet<TSource>(IEnumerable<TSource>)

Tworzy obiekt na HashSet<T> podstawie elementu IEnumerable<T>.

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

Tworzy obiekt HashSet<T>IEnumerable<T> na podstawie elementu comparer , aby porównać klucze.

ToHashSet<TSource>(IEnumerable<TSource>)

Źródło:
ToCollection.cs
Źródło:
ToCollection.cs
Źródło:
ToCollection.cs

Tworzy obiekt na HashSet<T> podstawie elementu IEnumerable<T>.

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

Parametry typu

TSource

Typ elementów elementu source.

Parametry

source
IEnumerable<TSource>

Element IEnumerable<T> do utworzenia elementu HashSet<T> na podstawie.

Zwraca

HashSet<TSource>

Element HashSet<T> zawierający wartości typu TSource wybrane z sekwencji danych wejściowych.

Wyjątki

source to null.

Zobacz też

Dotyczy

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

Źródło:
ToCollection.cs
Źródło:
ToCollection.cs
Źródło:
ToCollection.cs

Tworzy obiekt HashSet<T>IEnumerable<T> na podstawie elementu comparer , aby porównać klucze.

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

Parametry typu

TSource

Typ elementów elementu source.

Parametry

source
IEnumerable<TSource>

Element IEnumerable<T> do utworzenia elementu HashSet<T> na podstawie.

comparer
IEqualityComparer<TSource>

Element IEqualityComparer<T> do porównywania kluczy.

Zwraca

HashSet<TSource>

Element HashSet<T> zawierający wartości typu TSource wybrane z sekwencji danych wejściowych.

Wyjątki

source to null.

Zobacz też

Dotyczy