Enumerable.ToHashSet Método

Definición

Sobrecargas

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

Crea un objeto HashSet<T> a partir de una instancia de IEnumerable<T> mediante comparer para comparar claves.Creates a HashSet<T> from an IEnumerable<T> using the comparer to compare keys.

ToHashSet<TSource>(IEnumerable<TSource>)

Crea un HashSet<T> a partir de un IEnumerable<T>.Creates a HashSet<T> from an IEnumerable<T>.

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

Crea un objeto HashSet<T> a partir de una instancia de IEnumerable<T> mediante comparer para comparar claves.Creates a HashSet<T> from an IEnumerable<T> using the comparer to compare keys.

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)

Parámetros de tipo

TSource

Tipo de los elementos de source.The type of the elements of source.

Parámetros

source
IEnumerable<TSource>

IEnumerable<T> a partir del que se va a crear un HashSet<T>.An IEnumerable<T> to create a HashSet<T> from.

comparer
IEqualityComparer<TSource>

IEqualityComparer<T> para comparar claves.An IEqualityComparer<T> to compare keys.

Devoluciones

HashSet<TSource>

HashSet<T> que contiene valores de tipo TSource seleccionados en la secuencia de entrada.A HashSet<T> that contains values of type TSource selected from the input sequence.

Se aplica a

ToHashSet<TSource>(IEnumerable<TSource>)

Crea un HashSet<T> a partir de un IEnumerable<T>.Creates a HashSet<T> from an 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)

Parámetros de tipo

TSource

Tipo de los elementos de source.The type of the elements of source.

Parámetros

source
IEnumerable<TSource>

IEnumerable<T> a partir del que se va a crear un HashSet<T>.An IEnumerable<T> to create a HashSet<T> from.

Devoluciones

HashSet<TSource>

HashSet<T> que contiene valores de tipo TSource seleccionados en la secuencia de entrada.A HashSet<T> that contains values of type TSource selected from the input sequence.

Se aplica a