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

適用於