MemoryCacheEntryExtensions.AddExpirationToken Method

Definition

Expires the cache entry if the given IChangeToken expires.

C#
public static Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions AddExpirationToken(this Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions options, Microsoft.Extensions.Primitives.IChangeToken expirationToken);

Parameters

expirationToken
IChangeToken

The IChangeToken that causes the cache entry to expire.

Returns

The MemoryCacheEntryOptions so that additional calls can be chained.

Applies to

Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)