共用方式為


DistributedCacheEntryExtensions.SetAbsoluteExpiration 方法

定義

多載

SetAbsoluteExpiration(DistributedCacheEntryOptions, DateTimeOffset)

設定快取項目的絕對到期日。

SetAbsoluteExpiration(DistributedCacheEntryOptions, TimeSpan)

設定相對於 now 的絕對到期時間。

SetAbsoluteExpiration(DistributedCacheEntryOptions, DateTimeOffset)

來源:
DistributedCacheEntryExtensions.cs
來源:
DistributedCacheEntryExtensions.cs
來源:
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)

來源:
DistributedCacheEntryExtensions.cs
來源:
DistributedCacheEntryExtensions.cs
來源:
DistributedCacheEntryExtensions.cs

設定相對於 now 的絕對到期時間。

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

相對於 now 的到期時間。

傳回

適用於