Dictionary<TKey,TValue>.GetAlternateLookup<TAlternateKey> Método

Definição

Obtém uma instância de um tipo que pode ser usada para executar operações na corrente Dictionary<TKey,TValue> usando uma TAlternateKey chave em vez de uma TKey.

public:
generic <typename TAlternateKey>
 System::Collections::Generic::Dictionary<TKey, TValue>::AlternateLookup<TAlternateKey> GetAlternateLookup();
public System.Collections.Generic.Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey> GetAlternateLookup<TAlternateKey>() where TAlternateKey : allows ref struct;
member this.GetAlternateLookup : unit -> System.Collections.Generic.Dictionary<'Key, 'Value>.AlternateLookup<'AlternateKey>
Public Function GetAlternateLookup(Of TAlternateKey) () As Dictionary(Of TKey, TValue).AlternateLookup(Of TAlternateKey)

Parâmetros de tipo

TAlternateKey

O tipo alternativo de uma chave para executar pesquisas.

Retornos

A instância de pesquisa criada.

Exceções

O comparador do dicionário não é compatível com TAlternateKey.

Comentários

O dicionário deve usar um comparador que implemente IAlternateEqualityComparer<TAlternate,T> com TAlternateKey e TKey. Se isso não ocorrer, uma exceção será gerada.

Aplica-se a