ObjectCache.GetValues 方法

定義

取得一組快取項目。Gets a set of cache entries.

多載

GetValues(IEnumerable<String>, String)

在衍生類別中遭覆寫時,取得對應至指定索引鍵的快取項目組。When overridden in a derived class, gets a set of cache entries that correspond to the specified keys.

GetValues(String, String[])

取得對應至指定索引鍵的快取項目組。Gets a set of cache entries that correspond to the specified keys.

GetValues(IEnumerable<String>, String)

在衍生類別中遭覆寫時,取得對應至指定索引鍵的快取項目組。When overridden in a derived class, gets a set of cache entries that correspond to the specified keys.

public abstract System.Collections.Generic.IDictionary<string,object> GetValues (System.Collections.Generic.IEnumerable<string> keys, string regionName = default);
abstract member GetValues : seq<string> * string -> System.Collections.Generic.IDictionary<string, obj>
Public MustOverride Function GetValues (keys As IEnumerable(Of String), Optional regionName As String = null) As IDictionary(Of String, Object)

參數

keys
IEnumerable<String>

要取得之快取項目的唯一識別項集合。A collection of unique identifiers for the cache entries to get.

regionName
String

選擇性。Optional. 如果已實作區域,則為快取中已加入一個或多個快取項目的具名區域。A named region in the cache to which the cache entry or entries were added, if regions are implemented. 選擇性參數的預設值為 nullThe default value for the optional parameter is null.

傳回

字典,表示快取項目的索引鍵/值組。A dictionary of key/value pairs that represent cache entries.

備註

GetValues(IEnumerable<String>, String) 方法多載是分散式快取的效能優化,可支援在單一網路呼叫期間從快取中提取多個快取專案。The GetValues(IEnumerable<String>, String) method overload is a performance optimization for distributed caches that support fetching multiple cache entries from the cache during a single network call.

雖然呼叫端可以將一或多個金鑰傳遞至方法,但並不保證所有索引鍵都代表快取中的專案。Although a caller can pass one or more keys to the method, there is no guarantee that all keys represent entries in the cache. 因此,傳回的字典可能會包含比傳遞至方法的索引鍵數目少的專案。Therefore, the returned dictionary might contain fewer items than the number of keys that were passed to the method.

GetValues(String, String[])

取得對應至指定索引鍵的快取項目組。Gets a set of cache entries that correspond to the specified keys.

public:
 virtual System::Collections::Generic::IDictionary<System::String ^, System::Object ^> ^ GetValues(System::String ^ regionName, ... cli::array <System::String ^> ^ keys);
public virtual System.Collections.Generic.IDictionary<string,object> GetValues (string regionName, params string[] keys);
abstract member GetValues : string * string[] -> System.Collections.Generic.IDictionary<string, obj>
override this.GetValues : string * string[] -> System.Collections.Generic.IDictionary<string, obj>
Public Overridable Function GetValues (regionName As String, ParamArray keys As String()) As IDictionary(Of String, Object)

參數

regionName
String

選擇性。Optional. 如果已實作區域,則為快取中已加入一個或多個快取項目的具名區域。A named region in the cache to which the cache entry or entries were added, if regions are implemented. 由於未在 .NET Framework 4.NET Framework 4 中實作區域,因此預設為 nullBecause regions are not implemented in .NET Framework 4.NET Framework 4, the default is null.

keys
String[]

要取得之快取項目的唯一識別項集合。A collection of unique identifiers for the cache entries to get.

傳回

字典,表示快取項目的索引鍵/值組。A dictionary of key/value pairs that represent cache entries.

備註

ObjectCache.GetValues 方法多載就像 GetValues(IEnumerable<String>, String) 方法多載,但可讓您使用 managed 語言所支援的選擇性參數語法(例如) C#來傳遞已命名的區域。The ObjectCache.GetValues method overload is like the GetValues(IEnumerable<String>, String) method overload, but lets you pass the named region by using optional parameter syntax that is supported by managed languages such as C#.

這個方法是虛擬方法,因為 ObjectCache 類別會提供將 params 陣列傳遞給 GetValues(IEnumerable<String>, String) 方法多載的預設實值。This method is a virtual method because the ObjectCache class provides a default implementation that passes the params array to the GetValues(IEnumerable<String>, String) method overload.

適用於