GenericCacheTKey, TValueGet 方法

获取缓存项 如果缓存中不存在指定的键,则返回默认值

Definition

命名空间: Suresking.Utility
程序集: Suresking.Utility (在 Suresking.Utility.dll 中) 版本:1.3.22+a27276bb8ffde055e69ff608e98aafba279e1e99
C#
public static TValue Get(
	TKey key,
	TValue defaultValue = null
)

参数

key  TKey
要获取的缓存键
defaultValue  TValue  (Optional)
缓存不存在时返回的默认值,默认为default(TValue)

返回值

TValue
如果存在则返回缓存值,否则返回默认值

参见