MemoryCacheEntryExtensions 類別

定義

提供作業的 MemoryCacheEntryOptions 擴充方法。

public ref class MemoryCacheEntryExtensions abstract sealed
public static class MemoryCacheEntryExtensions
type MemoryCacheEntryExtensions = class
Public Module MemoryCacheEntryExtensions
繼承
MemoryCacheEntryExtensions

方法

AddExpirationToken(MemoryCacheEntryOptions, IChangeToken)

如果指定的 IChangeToken 過期,快取項目即過期。

RegisterPostEvictionCallback(MemoryCacheEntryOptions, PostEvictionDelegate)

從快取收回快取項目後,將會引發的指定回呼。

RegisterPostEvictionCallback(MemoryCacheEntryOptions, PostEvictionDelegate, Object)

從快取收回快取項目後,將會引發的指定回呼。

SetAbsoluteExpiration(MemoryCacheEntryOptions, DateTimeOffset)

設定快取項目的絕對到期日。

SetAbsoluteExpiration(MemoryCacheEntryOptions, TimeSpan)

設定相對於 now 的絕對到期時間。

SetPriority(MemoryCacheEntryOptions, CacheItemPriority)

設定於設定記憶體壓力權杖清除期間,將快取項目保留在快取中的優先順序。

SetSize(MemoryCacheEntryOptions, Int64)

設定快取項目值的大小。

SetSlidingExpiration(MemoryCacheEntryOptions, TimeSpan)

或設定快取項目在移除前可處於非使用中狀態的時間長度 (例如,未經存取)。 這不會讓項目存留期超過絕對到期的時間 (如已設定)。

適用於