語言

ConcurrentDictionary<TKey,TValue>.GetAlternateLookup<TAlternateKey> 方法

定義

取得一個型 ConcurrentDictionary<TKey,TValue> 別的實例,可用於使用 a TAlternateKey 作為鍵而非 TKey。

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

類型參數

TAlternateKey

用於查找的另一種金鑰。

傳回

建立的查詢實例。

例外狀況

此實例的比較器與 TAlternateKey不相容。

備註

此實例必須使用一個實 IAlternateEqualityComparer<TAlternate,T> 作為 和 TAlternateKeyTKey的比較器。 如果沒有,就會拋出例外。

適用於