共用方式為


CacheEntryExtensions.SetSlidingExpiration(ICacheEntry, TimeSpan) 方法

定義

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

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

參數

offset
TimeSpan

表示滑動期限的 TimeSpan

傳回

用於鏈結的 ICacheEntry

適用於