MemoryCacheEntryExtensions.SetSlidingExpiration 方法

定義

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

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Caching::Memory::MemoryCacheEntryOptions ^ SetSlidingExpiration(Microsoft::Extensions::Caching::Memory::MemoryCacheEntryOptions ^ options, TimeSpan offset);
public static Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions SetSlidingExpiration (this Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions options, TimeSpan offset);
static member SetSlidingExpiration : Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions * TimeSpan -> Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions
<Extension()>
Public Function SetSlidingExpiration (options As MemoryCacheEntryOptions, offset As TimeSpan) As MemoryCacheEntryOptions

參數

offset
TimeSpan

滑動期限時間。

傳回

MemoryCacheEntryOptions,以便鏈結其他呼叫。

適用於