Enumerable.ToHashSet Método

Definição

Sobrecargas

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

Cria um HashSet<T> a partir de um IEnumerable<T> usando o comparer para comparar as chaves.

ToHashSet<TSource>(IEnumerable<TSource>)

Cria um HashSet<T> a partir de um IEnumerable<T>.

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

Cria um HashSet<T> a partir de um IEnumerable<T> usando o comparer para comparar as chaves.

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)

Parâmetros de Tipo Genérico

TSource

O tipo dos elementos de source.

Parâmetros

source
IEnumerable<TSource>

E IEnumerable<T> para criar um HashSet<T> a partir de.

comparer
IEqualityComparer<TSource>

E IEqualityComparer<T> para comparar tonalidades.

Devoluções

HashSet<TSource>

A HashSet<T> que contém valores do tipo TSource selecionados da sequência de entrada.

Exceções

source é null.

Ver também

Aplica-se a

ToHashSet<TSource>(IEnumerable<TSource>)

Cria um HashSet<T> a partir de um 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 Genérico

TSource

O tipo dos elementos de source.

Parâmetros

source
IEnumerable<TSource>

E IEnumerable<T> para criar um HashSet<T> a partir de.

Devoluções

HashSet<TSource>

A HashSet<T> que contém valores do tipo TSource selecionados da sequência de entrada.

Exceções

source é null.

Ver também

Aplica-se a