ObjectCache.GetValues 方法

定义

获取一组缓存项。

重载

GetValues(IEnumerable<String>, String)

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

GetValues(String, String[])

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

GetValues(IEnumerable<String>, String)

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

可选。 缓存中添加了一个或多个缓存项的命名区域(如果实现了区域)。 可选参数的默认值为 null

返回

一个表示缓存项的键/值对字典。

注解

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

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

适用于

GetValues(String, String[])

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

可选。 缓存中添加了一个或多个缓存项的命名区域(如果实现了区域)。 由于区域未在 .NET Framework 4 中实现,因此默认值为 null

keys
String[]

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

返回

一个表示缓存项的键/值对字典。

注解

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

此方法是虚拟方法,ObjectCache因为 类提供将数组传递给paramsGetValues(IEnumerable<String>, String)方法重载的默认实现。

适用于