MemoryCacheEntryExtensions.SetAbsoluteExpiration Method

Definition

Overloads

SetAbsoluteExpiration(MemoryCacheEntryOptions, DateTimeOffset)

Sets an absolute expiration date for the cache entry.

SetAbsoluteExpiration(MemoryCacheEntryOptions, TimeSpan)

Sets an absolute expiration time, relative to now.

SetAbsoluteExpiration(MemoryCacheEntryOptions, DateTimeOffset)

Sets an absolute expiration date for the cache entry.

public static Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions SetAbsoluteExpiration (this Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions options, DateTimeOffset absolute);
Parameters
absolute
DateTimeOffset
Returns

SetAbsoluteExpiration(MemoryCacheEntryOptions, TimeSpan)

Sets an absolute expiration time, relative to now.

public static Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions SetAbsoluteExpiration (this Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions options, TimeSpan relative);
Parameters
relative
TimeSpan
Returns

Applies to