ParallelEnumerable.ToDictionary ParallelEnumerable.ToDictionary ParallelEnumerable.ToDictionary ParallelEnumerable.ToDictionary Method

Definição

Sobrecargas

ToDictionary<TSource,TKey,TElement>(ParallelQuery<TSource>, Func<TSource,TKey>, Func<TSource,TElement>) ToDictionary<TSource,TKey,TElement>(ParallelQuery<TSource>, Func<TSource,TKey>, Func<TSource,TElement>) ToDictionary<TSource,TKey,TElement>(ParallelQuery<TSource>, Func<TSource,TKey>, Func<TSource,TElement>) ToDictionary<TSource,TKey,TElement>(ParallelQuery<TSource>, Func<TSource,TKey>, Func<TSource,TElement>)

Cria um Dictionary<TKey,TValue> de um ParallelQuery<TSource> de acordo com as funções especificadas de seletor de chave e seletor de elemento.Creates a Dictionary<TKey,TValue> from a ParallelQuery<TSource> according to specified key selector and element selector functions.

ToDictionary<TSource,TKey,TElement>(ParallelQuery<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>) ToDictionary<TSource,TKey,TElement>(ParallelQuery<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>) ToDictionary<TSource,TKey,TElement>(ParallelQuery<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>) ToDictionary<TSource,TKey,TElement>(ParallelQuery<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)

Cria um Dictionary<TKey,TValue> de um ParallelQuery<TSource> de acordo com uma função de seletor de chave, um comparador e uma função de seletor de elemento especificados.Creates a Dictionary<TKey,TValue> from a ParallelQuery<TSource> according to a specified key selector function, a comparer, and an element selector function.

ToDictionary<TSource,TKey>(ParallelQuery<TSource>, Func<TSource,TKey>) ToDictionary<TSource,TKey>(ParallelQuery<TSource>, Func<TSource,TKey>) ToDictionary<TSource,TKey>(ParallelQuery<TSource>, Func<TSource,TKey>) ToDictionary<TSource,TKey>(ParallelQuery<TSource>, Func<TSource,TKey>)

Cria um Dictionary<TKey,TValue> de um ParallelQuery<TSource> de acordo com uma função de seletor de chave especificada.Creates a Dictionary<TKey,TValue> from a ParallelQuery<TSource> according to a specified key selector function.

ToDictionary<TSource,TKey>(ParallelQuery<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>) ToDictionary<TSource,TKey>(ParallelQuery<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>) ToDictionary<TSource,TKey>(ParallelQuery<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>) ToDictionary<TSource,TKey>(ParallelQuery<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

Cria um Dictionary<TKey,TValue> de um ParallelQuery<TSource> de acordo com uma função de seletor de chave e um comparador de chaves especificados.Creates a Dictionary<TKey,TValue> from a ParallelQuery<TSource> according to a specified key selector function and key comparer.

ToDictionary<TSource,TKey,TElement>(ParallelQuery<TSource>, Func<TSource,TKey>, Func<TSource,TElement>) ToDictionary<TSource,TKey,TElement>(ParallelQuery<TSource>, Func<TSource,TKey>, Func<TSource,TElement>) ToDictionary<TSource,TKey,TElement>(ParallelQuery<TSource>, Func<TSource,TKey>, Func<TSource,TElement>) ToDictionary<TSource,TKey,TElement>(ParallelQuery<TSource>, Func<TSource,TKey>, Func<TSource,TElement>)

Cria um Dictionary<TKey,TValue> de um ParallelQuery<TSource> de acordo com as funções especificadas de seletor de chave e seletor de elemento.Creates a Dictionary<TKey,TValue> from a ParallelQuery<TSource> according to specified key selector and element selector functions.

public:
generic <typename TSource, typename TKey, typename TElement>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::Dictionary<TKey, TElement> ^ ToDictionary(System::Linq::ParallelQuery<TSource> ^ source, Func<TSource, TKey> ^ keySelector, Func<TSource, TElement> ^ elementSelector);
public static System.Collections.Generic.Dictionary<TKey,TElement> ToDictionary<TSource,TKey,TElement> (this System.Linq.ParallelQuery<TSource> source, Func<TSource,TKey> keySelector, Func<TSource,TElement> elementSelector);
static member ToDictionary : System.Linq.ParallelQuery<'Source> * Func<'Source, 'Key> * Func<'Source, 'Element> -> System.Collections.Generic.Dictionary<'Key, 'Element>
<Extension()>
Public Function ToDictionary(Of TSource, TKey, TElement) (source As ParallelQuery(Of TSource), keySelector As Func(Of TSource, TKey), elementSelector As Func(Of TSource, TElement)) As Dictionary(Of TKey, TElement)

Parâmetros de tipo

TSource

O tipo dos elementos de source.The type of the elements of source.

TKey

O tipo da chave retornada por keySelector.The type of the key returned by keySelector.

TElement

O tipo do valor retornado por elementSelector.The type of the value returned by elementSelector.

Parâmetros

keySelector
Func<TSource,TKey>

Uma função para extrair uma chave de cada elemento.A function to extract a key from each element.

elementSelector
Func<TSource,TElement>

Uma função de transformação para produzir um valor de elemento de resultado de cada elemento.A transform function to produce a result element value from each element.

Retornos

Dictionary<TKey,TElement>

Um Dictionary<TKey,TValue> que contém os valores do tipo TElement selecionados da sequência de entradaA Dictionary<TKey,TValue> that contains values of type TElement selected from the input sequence

Exceções

A consulta foi cancelada com o token transmitido pelo WithCancellation.The query was canceled with the token passed in through WithCancellation.

source ou keySelector ou elementSelector é uma referência nula (Nothing no Visual Basic).source or keySelector or elementSelector is a null reference (Nothing in Visual Basic).

keySelector gera uma chave que é uma referência nula (Nothing no Visual Basic).keySelector produces a key that is a null reference (Nothing in Visual Basic). -ou- keySelector produz chaves duplicadas para os dois elementos.-or- keySelector produces duplicate keys for two elements. -ou- Uma ou mais exceções ocorreram durante a avaliação da consulta.-or- One or more exceptions occurred during the evaluation of the query.

Veja também

ToDictionary<TSource,TKey,TElement>(ParallelQuery<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>) ToDictionary<TSource,TKey,TElement>(ParallelQuery<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>) ToDictionary<TSource,TKey,TElement>(ParallelQuery<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>) ToDictionary<TSource,TKey,TElement>(ParallelQuery<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)

Cria um Dictionary<TKey,TValue> de um ParallelQuery<TSource> de acordo com uma função de seletor de chave, um comparador e uma função de seletor de elemento especificados.Creates a Dictionary<TKey,TValue> from a ParallelQuery<TSource> according to a specified key selector function, a comparer, and an element selector function.

public:
generic <typename TSource, typename TKey, typename TElement>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::Dictionary<TKey, TElement> ^ ToDictionary(System::Linq::ParallelQuery<TSource> ^ source, Func<TSource, TKey> ^ keySelector, Func<TSource, TElement> ^ elementSelector, System::Collections::Generic::IEqualityComparer<TKey> ^ comparer);
public static System.Collections.Generic.Dictionary<TKey,TElement> ToDictionary<TSource,TKey,TElement> (this System.Linq.ParallelQuery<TSource> source, Func<TSource,TKey> keySelector, Func<TSource,TElement> elementSelector, System.Collections.Generic.IEqualityComparer<TKey> comparer);
static member ToDictionary : System.Linq.ParallelQuery<'Source> * Func<'Source, 'Key> * Func<'Source, 'Element> * System.Collections.Generic.IEqualityComparer<'Key> -> System.Collections.Generic.Dictionary<'Key, 'Element>
<Extension()>
Public Function ToDictionary(Of TSource, TKey, TElement) (source As ParallelQuery(Of TSource), keySelector As Func(Of TSource, TKey), elementSelector As Func(Of TSource, TElement), comparer As IEqualityComparer(Of TKey)) As Dictionary(Of TKey, TElement)

Parâmetros de tipo

TSource

O tipo dos elementos de source.The type of the elements of source.

TKey

O tipo da chave retornada por keySelector.The type of the key returned by keySelector.

TElement

O tipo do valor retornado por elementSelector.The type of the value returned by elementSelector.

Parâmetros

keySelector
Func<TSource,TKey>

Uma função para extrair uma chave de cada elemento.A function to extract a key from each element.

elementSelector
Func<TSource,TElement>

Uma função de transformação para produzir um valor de elemento de resultado de cada elemento.A transform function to produce a result element value from each element.

comparer
IEqualityComparer<TKey>

Um IEqualityComparer<T> para comparar chaves.An IEqualityComparer<T> to compare keys.

Retornos

Dictionary<TKey,TElement>

Um Dictionary<TKey,TValue> que contém os valores do tipo TElement selecionados da sequência de entradaA Dictionary<TKey,TValue> that contains values of type TElement selected from the input sequence

Exceções

A consulta foi cancelada com o token transmitido pelo WithCancellation.The query was canceled with the token passed in through WithCancellation.

source ou keySelector ou elementSelector é uma referência nula (Nothing no Visual Basic).source or keySelector or elementSelector is a null reference (Nothing in Visual Basic).

keySelector gera uma chave que é uma referência nula (Nothing no Visual Basic).keySelector produces a key that is a null reference (Nothing in Visual Basic). -ou- keySelector produz chaves duplicadas para os dois elementos.-or- keySelector produces duplicate keys for two elements. -ou- Uma ou mais exceções ocorreram durante a avaliação da consulta.-or- One or more exceptions occurred during the evaluation of the query.

Veja também

ToDictionary<TSource,TKey>(ParallelQuery<TSource>, Func<TSource,TKey>) ToDictionary<TSource,TKey>(ParallelQuery<TSource>, Func<TSource,TKey>) ToDictionary<TSource,TKey>(ParallelQuery<TSource>, Func<TSource,TKey>) ToDictionary<TSource,TKey>(ParallelQuery<TSource>, Func<TSource,TKey>)

Cria um Dictionary<TKey,TValue> de um ParallelQuery<TSource> de acordo com uma função de seletor de chave especificada.Creates a Dictionary<TKey,TValue> from a ParallelQuery<TSource> according to a specified key selector function.

public:
generic <typename TSource, typename TKey>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::Dictionary<TKey, TSource> ^ ToDictionary(System::Linq::ParallelQuery<TSource> ^ source, Func<TSource, TKey> ^ keySelector);
public static System.Collections.Generic.Dictionary<TKey,TSource> ToDictionary<TSource,TKey> (this System.Linq.ParallelQuery<TSource> source, Func<TSource,TKey> keySelector);
static member ToDictionary : System.Linq.ParallelQuery<'Source> * Func<'Source, 'Key> -> System.Collections.Generic.Dictionary<'Key, 'Source>
<Extension()>
Public Function ToDictionary(Of TSource, TKey) (source As ParallelQuery(Of TSource), keySelector As Func(Of TSource, TKey)) As Dictionary(Of TKey, TSource)

Parâmetros de tipo

TSource

O tipo dos elementos de source.The type of the elements of source.

TKey

O tipo da chave retornada por keySelector.The type of the key returned by keySelector.

Parâmetros

keySelector
Func<TSource,TKey>

Uma função para extrair uma chave de cada elemento.A function to extract a key from each element.

Retornos

Dictionary<TKey,TSource>

Um Dictionary<TKey,TValue> que contém chaves e valores.A Dictionary<TKey,TValue> that contains keys and values.

Exceções

A consulta foi cancelada com o token transmitido pelo WithCancellation.The query was canceled with the token passed in through WithCancellation.

source ou keySelector é uma referência nula (Nothing no Visual Basic).source or keySelector is a null reference (Nothing in Visual Basic).

keySelector gera uma chave que é uma referência nula (Nothing no Visual Basic).keySelector produces a key that is a null reference (Nothing in Visual Basic). -ou- keySelector produz chaves duplicadas para os dois elementos.-or- keySelector produces duplicate keys for two elements. -ou- Uma ou mais exceções ocorreram durante a avaliação da consulta.-or- One or more exceptions occurred during the evaluation of the query.

Veja também

ToDictionary<TSource,TKey>(ParallelQuery<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>) ToDictionary<TSource,TKey>(ParallelQuery<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>) ToDictionary<TSource,TKey>(ParallelQuery<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>) ToDictionary<TSource,TKey>(ParallelQuery<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

Cria um Dictionary<TKey,TValue> de um ParallelQuery<TSource> de acordo com uma função de seletor de chave e um comparador de chaves especificados.Creates a Dictionary<TKey,TValue> from a ParallelQuery<TSource> according to a specified key selector function and key comparer.

public:
generic <typename TSource, typename TKey>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::Dictionary<TKey, TSource> ^ ToDictionary(System::Linq::ParallelQuery<TSource> ^ source, Func<TSource, TKey> ^ keySelector, System::Collections::Generic::IEqualityComparer<TKey> ^ comparer);
public static System.Collections.Generic.Dictionary<TKey,TSource> ToDictionary<TSource,TKey> (this System.Linq.ParallelQuery<TSource> source, Func<TSource,TKey> keySelector, System.Collections.Generic.IEqualityComparer<TKey> comparer);
static member ToDictionary : System.Linq.ParallelQuery<'Source> * Func<'Source, 'Key> * System.Collections.Generic.IEqualityComparer<'Key> -> System.Collections.Generic.Dictionary<'Key, 'Source>
<Extension()>
Public Function ToDictionary(Of TSource, TKey) (source As ParallelQuery(Of TSource), keySelector As Func(Of TSource, TKey), comparer As IEqualityComparer(Of TKey)) As Dictionary(Of TKey, TSource)

Parâmetros de tipo

TSource

O tipo dos elementos de source.The type of the elements of source.

TKey

O tipo da chave retornada por keySelector.The type of the key returned by keySelector.

Parâmetros

keySelector
Func<TSource,TKey>

Uma função para extrair uma chave de cada elemento.A function to extract a key from each element.

comparer
IEqualityComparer<TKey>

Um IEqualityComparer<T> para comparar chaves.An IEqualityComparer<T> to compare keys.

Retornos

Dictionary<TKey,TSource>

Um Dictionary<TKey,TValue> que contém chaves e valores.A Dictionary<TKey,TValue> that contains keys and values.

Exceções

A consulta foi cancelada com o token transmitido pelo WithCancellation.The query was canceled with the token passed in through WithCancellation.

source ou keySelector é uma referência nula (Nothing no Visual Basic).source or keySelector is a null reference (Nothing in Visual Basic).

keySelector gera uma chave que é uma referência nula (Nothing no Visual Basic).keySelector produces a key that is a null reference (Nothing in Visual Basic). -ou- keySelector produz chaves duplicadas para os dois elementos.-or- keySelector produces duplicate keys for two elements. -ou- Uma ou mais exceções ocorreram durante a avaliação da consulta.-or- One or more exceptions occurred during the evaluation of the query.

Veja também

Aplica-se a