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

适用于