共用方式為


DistributedCacheEntryExtensions.SetSlidingExpiration 方法

定義

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

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

參數

options
DistributedCacheEntryOptions

要操作的選項。

offset
TimeSpan

滑動期限時間。

傳回

適用於