你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Extensions.GetOrAddWithCast<TKey,T,TBase> Method

Definition

public static T GetOrAddWithCast<TKey,T,TBase> (this System.Collections.Concurrent.ConcurrentDictionary<TKey,TBase> dictionary, TKey key, Func<T> add) where T : TBase;
static member GetOrAddWithCast : System.Collections.Concurrent.ConcurrentDictionary<'Key, 'Base> * 'Key * Func<#'Base> -> 'T
<Extension()>
Public Function GetOrAddWithCast(Of TKey, T, TBase) (dictionary As ConcurrentDictionary(Of TKey, TBase), key As TKey, add As Func(Of T)) As T

Type Parameters

TKey
T
TBase

Parameters

dictionary
ConcurrentDictionary<TKey,TBase>
key
TKey
add
Func<T>

Returns

T

Applies to