ObjectCache.GetValues ObjectCache.GetValues ObjectCache.GetValues ObjectCache.GetValues Method

定义

获取一组缓存项。Gets a set of cache entries.

重载

GetValues(IEnumerable<String>, String) GetValues(IEnumerable<String>, String) 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[]) GetValues(String, String[]) GetValues(String, String[]) GetValues(String, String[])

获取与指定的键对应的一组缓存项。Gets a set of cache entries that correspond to the specified keys.

GetValues(IEnumerable<String>, String) GetValues(IEnumerable<String>, String) 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 = null);
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 String String 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[]) GetValues(String, String[]) GetValues(String, String[]) 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 String String 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)方法重载,但允许使用可选参数语法支持的 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.

适用于