MemoryCache.Get(String, String) 方法

定義

從快取傳回項目。

public override object Get (string key, string regionName = default);
override this.Get : string * string -> obj
Public Overrides Function Get (key As String, Optional regionName As String = Nothing) As Object

參數

key
String

要取得之快取項目的唯一識別項。

regionName
String

快取區中的具名區域,已將快取項目加入其中。 請勿傳遞這個參數的值。 這個參數預設為 null,因為 MemoryCache 類別沒有實作區域。

傳回

如果由 key 所識別的快取項目存在,則為該快取項目的參考,否則為 null

例外狀況

regionName 不是 null

keynull

適用於