ConcurrentDictionary<TKey,TValue>.GetAlternateLookup<TAlternateKey> 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得一個型 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的比較器。 如果沒有,就會拋出例外。