ObjectCache.GetValues 方法

定义

获取一组缓存条目。

重载

名称 说明
GetValues(IEnumerable<String>, String)

在派生类中重写时,获取一组对应于指定键的缓存条目。

GetValues(String, String[])

获取一组对应于指定键的缓存项。

GetValues(IEnumerable<String>, String)

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

在派生类中重写时,获取一组对应于指定键的缓存条目。

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)

参数

keys
IEnumerable<String>

要获取的缓存项的唯一标识符的集合。

regionName
String

Optional. 如果实现了区域,则缓存项或条目添加到缓存中的命名区域。 可选参数的默认值为 null

返回

表示缓存条目的键/值对字典。

注解

方法 GetValues(IEnumerable<String>, String) 重载是分布式缓存的性能优化,支持在单个网络调用期间从缓存中提取多个缓存条目。

尽管调用方可以将一个或多个键传递给该方法,但不能保证所有键都表示缓存中的条目。 因此,返回的字典可能包含的项数可能少于传递给该方法的键数。

适用于

GetValues(String, String[])

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

获取一组对应于指定键的缓存项。

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. 如果实现了区域,则缓存项或条目添加到缓存中的命名区域。 由于区域未在 .NET Framework 4 中实现,因此默认值为 null

keys
String[]

要获取的缓存项的唯一标识符的集合。

返回

表示缓存条目的键/值对字典。

注解

方法 ObjectCache.GetValues 重载类似于 GetValues(IEnumerable<String>, String) 方法重载,但允许使用受托管语言(如 C#)支持的可选参数语法传递命名区域。

此方法是一种虚拟方法, ObjectCache 因为该类提供一个默认实现,用于将 params 数组传递到 GetValues(IEnumerable<String>, String) 方法重载。

适用于