MemoryCacheEntryExtensions 類別

定義

提供運算的 MemoryCacheEntryOptions 擴充方法。

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

方法

名稱 Description
AddExpirationToken(MemoryCacheEntryOptions, IChangeToken)

如果快 IChangeToken 取條目過期,該快取條目就會失效。

RegisterPostEvictionCallback(MemoryCacheEntryOptions, PostEvictionDelegate, Object)

在快取項目被逐出快取後,會觸發給定的回調。

RegisterPostEvictionCallback(MemoryCacheEntryOptions, PostEvictionDelegate)

在快取項目被逐出快取後,會觸發給定的回調。

SetAbsoluteExpiration(MemoryCacheEntryOptions, DateTimeOffset)

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

SetAbsoluteExpiration(MemoryCacheEntryOptions, TimeSpan)

設定一個絕對的有效期限,相對於現在。

SetPriority(MemoryCacheEntryOptions, CacheItemPriority)

設定在記憶體壓力標記清理期間,將快取條目保留在快取中的優先順序。

SetSize(MemoryCacheEntryOptions, Int64)

設定快取入口值的大小。

SetSlidingExpiration(MemoryCacheEntryOptions, TimeSpan)

設定快取項目可處於非活躍狀態(例如無法存取)的時間,之後才會被移除。 這不會延長進入壽命超過絕對到期日(若設定為如此)。

適用於