ObjectCache.Item[String] 屬性

定義

取得或設定 ObjectCache 類別的預設索引子。

public:
 abstract property System::Object ^ default[System::String ^] { System::Object ^ get(System::String ^ key); void set(System::String ^ key, System::Object ^ value); };
public abstract object this[string key] { get; set; }
member this.Item(string) : obj with get, set
Default Public MustOverride Property Item(key As String) As Object

參數

key
String

快取中快取項目的唯一識別項。

屬性值

索引鍵,做為快取執行個體中的索引子。

備註

這個屬性之 set 存取子的行為就像 方法一樣 Set(String, Object, DateTimeOffset, String) 。 在內部,快取實作可以將指定值的絕對到期時間設定為 InfiniteAbsoluteExpiration 方法。 不過,此行為最終會由快取實作決定。

get 存取子的行為就像呼叫 Get(String) 方法,並針對區域名稱使用 null

適用於