MemoryCache.GetValues Method (IEnumerable<String>, String)

.NET Framework (current version)

Returns a set of cache entries that correspond to the specified keys.

Namespace:   System.Runtime.Caching
Assembly:  System.Runtime.Caching (in System.Runtime.Caching.dll)

public override IDictionary<string, object> GetValues(
	IEnumerable<string> keys,
	string regionName = null


Type: System.Collections.Generic.IEnumerable<String>

A set of unique identifiers for the cache entries to return.

Type: System.String

A named region in the cache to which a cache entry was added. Do not pass a value for this parameter. This parameter is null by default, because the MemoryCache class does not implement regions.

Return Value

Type: System.Collections.Generic.IDictionary<String, Object>

A set of cache entries that correspond to the specified keys.

Exception Condition

regionName is not null.


keys is null.


An individual key in the collection is null.

If a cache entry that is represented by the keys does not exist, the corresponding value for the returned object in the dictionary is set to null. Therefore, the returned dictionary always has the same number of items as the number of elements in keys.

.NET Framework
Available since 4.0
Return to top