ObjectCache.GetCacheItem(String, String) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
當在衍生類別中覆寫時,會從該快取中取得指定的快取項目作為 CacheItem 實例。
public abstract System.Runtime.Caching.CacheItem GetCacheItem(string key, string regionName = default);
abstract member GetCacheItem : string * string -> System.Runtime.Caching.CacheItem
Public MustOverride Function GetCacheItem (key As String, Optional regionName As String = Nothing) As CacheItem
參數
- key
- String
快取項目要取得的唯一識別碼。
- regionName
- String
Optional. 如果有實作區域,則指該快取加入的快取中命名的區域。 由於 Framework 4 .NET未實作區域,預設為 null。
傳回
由 識別 key的快取條目。
備註
此方法過載存在是因為某些快取實作可能會擴充該 CacheItem 類別。 在這種情況下, Get(String, String) 方法過載不一定會回傳快取資料的所有資訊。 然而, GetCacheItem(String, String) 方法過載使自訂快取能回傳的不僅僅是快取值。
此 GetCacheItem(String, String) 方法與 方法 Get(String, String) 相似,不同之處在於回 GetCacheItem(String, String) 傳快取條目為 CacheItem 實例。