MemoryCache.GetValues(IEnumerable<String>, String) 方法

定义

返回与指定的键对应的一组缓存项。

public override System.Collections.Generic.IDictionary<string,object> GetValues (System.Collections.Generic.IEnumerable<string> keys, string regionName = default);
override this.GetValues : seq<string> * string -> System.Collections.Generic.IDictionary<string, obj>
Public Overrides Function GetValues (keys As IEnumerable(Of String), Optional regionName As String = Nothing) As IDictionary(Of String, Object)

参数

keys
IEnumerable<String>

要返回的缓存项的一组唯一标识符。

regionName
String

缓存中的一个添加了缓存项的命名区域。 不要为该参数传递值。 默认情况下,此参数为null,因为 MemoryCache 类未实现区域。

返回

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

例外

regionName 不是 null

keysnull

集合中的单个键为 null

注解

如果 不存在由 keys 表示的缓存项,则字典中返回对象的相应值设置为 null。 因此,返回的字典的项数始终与 中的 keys元素数相同。

适用于