Enumerable.ToHashSet Methode

Definitie

Overloads

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

Hiermee maakt u een HashSet<T> van een IEnumerable<T> met behulp van de comparer sleutels om sleutels te vergelijken.

ToHashSet<TSource>(IEnumerable<TSource>)

Hiermee maakt u een HashSet<T> van een IEnumerable<T>.

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

Hiermee maakt u een HashSet<T> van een IEnumerable<T> met behulp van de comparer sleutels om sleutels te vergelijken.

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)

Type parameters

TSource

Het type van de elementen van source.

Parameters

source
IEnumerable<TSource>

Een IEnumerable<T> van waaruit u een HashSet<T> wilt maken.

comparer
IEqualityComparer<TSource>

Een IEqualityComparer<T> om sleutels te vergelijken.

Retouren

HashSet<TSource>

Een HashSet<T> met waarden van het type TSource dat is geselecteerd in de invoerreeks.

Uitzonderingen

source is null.

Zie ook

Van toepassing op

ToHashSet<TSource>(IEnumerable<TSource>)

Hiermee maakt u een HashSet<T> van een 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)

Type parameters

TSource

Het type van de elementen van source.

Parameters

source
IEnumerable<TSource>

Een IEnumerable<T> van waaruit u een HashSet<T> wilt maken.

Retouren

HashSet<TSource>

Een HashSet<T> met waarden van het type TSource dat is geselecteerd in de invoerreeks.

Uitzonderingen

source is null.

Zie ook

Van toepassing op