ConcurrentDictionary<TKey,TValue>.AlternateLookup<TAlternateKey> 结构

定义

提供一种类型,该类型可用于对用作ConcurrentDictionary<TKey,TValue>键而不是TAlternateKey键执行作TKey

public: generic <typename TAlternateKey>
value class ConcurrentDictionary<TKey, TValue>::AlternateLookup
public readonly struct ConcurrentDictionary<TKey,TValue>.AlternateLookup<TAlternateKey> where TAlternateKey : allows ref struct
type ConcurrentDictionary<'Key, 'Value>.AlternateLookup<'AlternateKey> = struct
Public Structure ConcurrentDictionary(Of TKey, TValue).AlternateLookup(Of TAlternateKey)

类型参数

TKey

字典中键的类型。

TValue

字典中值的类型。

TAlternateKey

用于执行查找的键的备用类型。

继承
ConcurrentDictionary<TKey,TValue>.AlternateLookup<TAlternateKey>

属性

名称 说明
Dictionary

ConcurrentDictionary<TKey,TValue>获取此实例对其执行操作的项。

Item[TAlternateKey]

获取或设置与指定的备用键关联的值。

方法

名称 说明
ContainsKey(TAlternateKey)

确定是否 ConcurrentDictionary<TKey,TValue> 包含指定的备用键。

TryAdd(TAlternateKey, TValue)

尝试将指定的键和值添加到字典。

TryGetValue(TAlternateKey, TKey, TValue)

获取与指定的备用键关联的值。

TryGetValue(TAlternateKey, TValue)

获取与指定的备用键关联的值。

TryRemove(TAlternateKey, TKey, TValue)

从 中移除具有指定备用键 Dictionary<TKey,TValue>的值,并将关联的键和元素复制到值参数。

TryRemove(TAlternateKey, TValue)

从 中移除具有指定备用键 Dictionary<TKey,TValue>的值,并将元素复制到 value 参数。

适用于