Enumerable.ToHashSet Methode

Definition

Überlädt

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

Erstellt mithilfe des HashSet<T> zum Vergleichen von Schlüsseln eine IEnumerable<T> aus einem comparer.

ToHashSet<TSource>(IEnumerable<TSource>)

Erstellt eine HashSet<T> aus einem IEnumerable<T>.

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

Erstellt mithilfe des HashSet<T> zum Vergleichen von Schlüsseln eine IEnumerable<T> aus einem comparer.

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);
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)

Typparameter

TSource

Der Typ der Elemente von source.

Parameter

source
IEnumerable<TSource>

Ein IEnumerable<T> , aus dem ein Element HashSet<T> erstellt werden soll.

comparer
IEqualityComparer<TSource>

Eine IEqualityComparer<T> zum Vergleichen von Schlüsseln.

Gibt zurück

HashSet<TSource>

Ein HashSet<T> Wert, der Werte vom Typ TSource enthält, die aus der Eingabesequenz ausgewählt sind.

Ausnahmen

source ist null.

Weitere Informationen

Gilt für:

ToHashSet<TSource>(IEnumerable<TSource>)

Erstellt eine HashSet<T> aus einem 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)

Typparameter

TSource

Der Typ der Elemente von source.

Parameter

source
IEnumerable<TSource>

Ein IEnumerable<T> , aus dem ein Element HashSet<T> erstellt werden soll.

Gibt zurück

HashSet<TSource>

Ein HashSet<T> Wert, der Werte vom Typ TSource enthält, die aus der Eingabesequenz ausgewählt sind.

Ausnahmen

source ist null.

Weitere Informationen

Gilt für: