CacheEntryExtensions.SetAbsoluteExpiration 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
SetAbsoluteExpiration(ICacheEntry, DateTimeOffset) |
为缓存项设置一个绝对到期日期。 |
SetAbsoluteExpiration(ICacheEntry, TimeSpan) |
设置一个相对于当前时间的绝对到期时间。 |
SetAbsoluteExpiration(ICacheEntry, DateTimeOffset)
- Source:
- CacheEntryExtensions.cs
- Source:
- CacheEntryExtensions.cs
为缓存项设置一个绝对到期日期。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Caching::Memory::ICacheEntry ^ SetAbsoluteExpiration(Microsoft::Extensions::Caching::Memory::ICacheEntry ^ entry, DateTimeOffset absolute);
public static Microsoft.Extensions.Caching.Memory.ICacheEntry SetAbsoluteExpiration (this Microsoft.Extensions.Caching.Memory.ICacheEntry entry, DateTimeOffset absolute);
static member SetAbsoluteExpiration : Microsoft.Extensions.Caching.Memory.ICacheEntry * DateTimeOffset -> Microsoft.Extensions.Caching.Memory.ICacheEntry
<Extension()>
Public Function SetAbsoluteExpiration (entry As ICacheEntry, absolute As DateTimeOffset) As ICacheEntry
参数
- entry
- ICacheEntry
- absolute
- DateTimeOffset
以绝对项表示到期时间的 DateTimeOffset。
返回
用于链接的 ICacheEntry。
适用于
SetAbsoluteExpiration(ICacheEntry, TimeSpan)
- Source:
- CacheEntryExtensions.cs
- Source:
- CacheEntryExtensions.cs
设置一个相对于当前时间的绝对到期时间。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Caching::Memory::ICacheEntry ^ SetAbsoluteExpiration(Microsoft::Extensions::Caching::Memory::ICacheEntry ^ entry, TimeSpan relative);
public static Microsoft.Extensions.Caching.Memory.ICacheEntry SetAbsoluteExpiration (this Microsoft.Extensions.Caching.Memory.ICacheEntry entry, TimeSpan relative);
static member SetAbsoluteExpiration : Microsoft.Extensions.Caching.Memory.ICacheEntry * TimeSpan -> Microsoft.Extensions.Caching.Memory.ICacheEntry
<Extension()>
Public Function SetAbsoluteExpiration (entry As ICacheEntry, relative As TimeSpan) As ICacheEntry
参数
- entry
- ICacheEntry
返回
用于链接的 ICacheEntry。