MemoryCacheEntryExtensions.SetAbsoluteExpiration 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
SetAbsoluteExpiration(MemoryCacheEntryOptions, DateTimeOffset) |
設定快取項目的絕對到期日。 |
SetAbsoluteExpiration(MemoryCacheEntryOptions, TimeSpan) |
設定相對於 now 的絕對到期時間。 |
SetAbsoluteExpiration(MemoryCacheEntryOptions, DateTimeOffset)
設定快取項目的絕對到期日。
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)
設定相對於 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,以便鏈結其他呼叫。