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

可调到期时间。

返回

适用于