EvictingDictionaryExpirationKind Enum
Definition
Specifies how an EvictingDictionary<TKey, TValue> measures an entry's time-to-live when expiration is configured through EvictingDictionaryExpiration.
public enum EvictingDictionaryExpirationKind
- Extension Methods
Fields
Absolute = 0The entry expires a fixed interval after it was added or last updated; read accesses do not extend its lifetime.
Sliding = 1The entry's expiration deadline is refreshed on every successful read access (
TryGetValue, the indexer getter, orContainsKey), so the entry expires only after remaining unread for its full time-to-live.
Remarks
The kind determines the point from which an entry's time-to-live is counted. Under Absolute the countdown starts when the entry is added (or its value is updated) and is unaffected by reads. Under Sliding every successful read access - TryGetValue(TKey, out TValue), the indexer getter, and ContainsKey(TKey) - restarts the countdown, keeping actively read entries alive indefinitely.
Enumeration never refreshes an entry's lifetime under either kind.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |