共用方式為


CacheEntryExtensions.SetAbsoluteExpiration 方法

定義

多載

SetAbsoluteExpiration(ICacheEntry, DateTimeOffset)

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

SetAbsoluteExpiration(ICacheEntry, TimeSpan)

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

SetAbsoluteExpiration(ICacheEntry, DateTimeOffset)

來源:
CacheEntryExtensions.cs
來源:
CacheEntryExtensions.cs
來源:
CacheEntryExtensions.cs

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

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

參數

absolute
DateTimeOffset

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

傳回

用於鏈結的 ICacheEntry

適用於

SetAbsoluteExpiration(ICacheEntry, TimeSpan)

來源:
CacheEntryExtensions.cs
來源:
CacheEntryExtensions.cs
來源:
CacheEntryExtensions.cs

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

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

參數

relative
TimeSpan

TimeSpan,表示相對於 now 的到期時間。

傳回

用於鏈結的 ICacheEntry

適用於