DistributedCacheEntryExtensions.SetAbsoluteExpiration 方法

定义

重载

SetAbsoluteExpiration(DistributedCacheEntryOptions, DateTimeOffset)

为缓存项设置一个绝对到期日期。

SetAbsoluteExpiration(DistributedCacheEntryOptions, TimeSpan)

设置一个相对于当前时间的绝对到期时间。

SetAbsoluteExpiration(DistributedCacheEntryOptions, DateTimeOffset)

Source:
DistributedCacheEntryExtensions.cs
Source:
DistributedCacheEntryExtensions.cs
Source:
DistributedCacheEntryExtensions.cs

为缓存项设置一个绝对到期日期。

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)

Source:
DistributedCacheEntryExtensions.cs
Source:
DistributedCacheEntryExtensions.cs
Source:
DistributedCacheEntryExtensions.cs

设置一个相对于当前时间的绝对到期时间。

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

相对于当前时间的到期时间。

返回

适用于