Editare

Partajați prin


ObjectCache.GetValues Method

Definition

Gets a set of cache entries.

Overloads

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)

Source:
ObjectCache.cs
Source:
ObjectCache.cs
Source:
ObjectCache.cs
Source:
ObjectCache.cs
Source:
ObjectCache.cs

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 = Nothing) As IDictionary(Of String, Object)

Parameters

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. The default value for the optional parameter is null.

Returns

A dictionary of key/value pairs that represent cache entries.

Remarks

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.

Applies to

GetValues(String, String[])

Source:
ObjectCache.cs
Source:
ObjectCache.cs
Source:
ObjectCache.cs
Source:
ObjectCache.cs
Source:
ObjectCache.cs

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)

Parameters

regionName
String

Optional. A named region in the cache to which the cache entry or entries were added, if regions are implemented. Because regions are not implemented in .NET Framework 4, the default is null.

keys
String[]

A collection of unique identifiers for the cache entries to get.

Returns

A dictionary of key/value pairs that represent cache entries.

Remarks

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#.

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.

Applies to