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