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.

注解

方法重载类似于方法重载, 但允许你通过使用托管语言 (例如) C#支持的可选参数语法来传递命名区域。 GetValues(IEnumerable<String>, String) ObjectCache.GetValuesThe 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.

适用于