MemoryCache.CreateCacheEntryChangeMonitor Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a CacheEntryChangeMonitor object that can trigger events in response to changes to specified cache entries.
public override System.Runtime.Caching.CacheEntryChangeMonitor CreateCacheEntryChangeMonitor (System.Collections.Generic.IEnumerable<string> keys, string regionName = default);
override this.CreateCacheEntryChangeMonitor : seq<string> * string -> System.Runtime.Caching.CacheEntryChangeMonitor
Public Overrides Function CreateCacheEntryChangeMonitor (keys As IEnumerable(Of String), Optional regionName As String = Nothing) As CacheEntryChangeMonitor
Parameters
- keys
- IEnumerable<String>
An enumeration of unique cache entry keys for the CacheEntryChangeMonitor object.
- regionName
- String
A named region in the cache to which a cache entry can be added. Do not pass a value for this parameter. This parameter is null
by default, because the MemoryCache class does not implement regions.
Returns
A change monitor that monitors entries in the cache.
Exceptions
regionName
is not null
.
keys
is null
.
An item in the keys
collection is null
.
Remarks
The CreateCacheEntryChangeMonitor method creates a CacheEntryChangeMonitor instance. This specialized change monitor is used to monitor the cache entries that are specified in the keys
collection and to trigger events when the entries change.
A monitored entry is considered to have changed for any of the following reasons:
The key does not exist at the time of the call to the CreateCacheEntryChangeMonitor method. In that case, the resulting CacheEntryChangeMonitor instance is immediately set to a changed state. This means that when code subsequently binds a change-notification callback, the callback is triggered immediately.
The associated cache entry was removed from the cache. This can occur if the entry is explicitly removed, if it expires, or if it is evicted to recover memory
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기