共用方式為


MemoryCacheEntryExtensions.SetAbsoluteExpiration 方法

定義

多載

SetAbsoluteExpiration(MemoryCacheEntryOptions, DateTimeOffset)

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

SetAbsoluteExpiration(MemoryCacheEntryOptions, TimeSpan)

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

SetAbsoluteExpiration(MemoryCacheEntryOptions, DateTimeOffset)

來源:
MemoryCacheEntryExtensions.cs
來源:
MemoryCacheEntryExtensions.cs
來源:
MemoryCacheEntryExtensions.cs

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

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Caching::Memory::MemoryCacheEntryOptions ^ SetAbsoluteExpiration(Microsoft::Extensions::Caching::Memory::MemoryCacheEntryOptions ^ options, DateTimeOffset absolute);
public static Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions SetAbsoluteExpiration (this Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions options, DateTimeOffset absolute);
static member SetAbsoluteExpiration : Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions * DateTimeOffset -> Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions
<Extension()>
Public Function SetAbsoluteExpiration (options As MemoryCacheEntryOptions, absolute As DateTimeOffset) As MemoryCacheEntryOptions

參數

absolute
DateTimeOffset

到期時間,以絕對字詞表示。

傳回

MemoryCacheEntryOptions,以便鏈結其他呼叫。

適用於

SetAbsoluteExpiration(MemoryCacheEntryOptions, TimeSpan)

來源:
MemoryCacheEntryExtensions.cs
來源:
MemoryCacheEntryExtensions.cs
來源:
MemoryCacheEntryExtensions.cs

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

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Caching::Memory::MemoryCacheEntryOptions ^ SetAbsoluteExpiration(Microsoft::Extensions::Caching::Memory::MemoryCacheEntryOptions ^ options, TimeSpan relative);
public static Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions SetAbsoluteExpiration (this Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions options, TimeSpan relative);
static member SetAbsoluteExpiration : Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions * TimeSpan -> Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions
<Extension()>
Public Function SetAbsoluteExpiration (options As MemoryCacheEntryOptions, relative As TimeSpan) As MemoryCacheEntryOptions

參數

relative
TimeSpan

相對於 now 的到期時間。

傳回

MemoryCacheEntryOptions,以便鏈結其他呼叫。

適用於