MemoryCacheExtensions extension

Extension methods for IMemoryCache.

on

Methods

get<T>(Object key) → T?

Available on IMemoryCache, provided by the MemoryCacheExtensions extension

Gets the value associated with key.
getOrCreate<T>(Object key, T factory(ICacheEntry entry)) → T

Available on IMemoryCache, provided by the MemoryCacheExtensions extension

Gets the value associated with key, or creates and caches a new value using factory if not found.
getOrCreateAsync<T>(Object key, Future<T> factory(ICacheEntry entry)) Future<T>

Available on IMemoryCache, provided by the MemoryCacheExtensions extension

Async version of getOrCreate.
set<T>(Object key, T value, [MemoryCacheEntryOptions? options]) → T

Available on IMemoryCache, provided by the MemoryCacheExtensions extension

Sets the value for key.