ObjectCache.CreateCacheEntryChangeMonitor Method

Definition

When overridden in a derived class, creates a CacheEntryChangeMonitor object that can trigger events in response to changes to specified cache entries.

C#
public abstract System.Runtime.Caching.CacheEntryChangeMonitor CreateCacheEntryChangeMonitor(System.Collections.Generic.IEnumerable<string> keys, string regionName = default);

Parameters

keys
IEnumerable<String>

The unique identifiers for cache entries to monitor.

regionName
String

Optional. A named region in the cache where the cache keys in the keys parameter exist, if regions are implemented. The default value for the optional parameter is null.

Returns

A change monitor that monitors cache entries in the cache.

Remarks

When a derived ObjectCache class overrides the base CreateCacheEntryChangeMonitor method, the cache implementation must create a CacheEntryChangeMonitor object. This specialized change monitor notifies callers when there are changes to the cache entries that are specified in the keys parameter. For example, if a monitored item in the keys parameter is updated or removed from the cache, the change monitor created by this method triggers an event.

If a cache implementation supports named cache regions, a string value can be specified as the regionName parameter. Otherwise, the parameter defaults to null.

Note

Not all cache implementations support cache-entry change monitors. To determine whether your cache implementation supports CacheEntryChangeMonitor objects, see the documentation for the specific cache implementation.

Applies to

Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)