HybridCache Class

Definition

Provides multi-tier caching services building on IDistributedCache backends.

C#
public abstract class HybridCache
Inheritance
HybridCache

Constructors

Methods

GetOrCreateAsync<T>(String, Func<CancellationToken,ValueTask<T>>, HybridCacheEntryOptions, IEnumerable<String>, CancellationToken)

Asynchronously gets the value associated with the key if it exists, or generates a new entry using the provided key and a value from the given factory if the key is not found.

GetOrCreateAsync<TState,T>(String, TState, Func<TState,CancellationToken, ValueTask<T>>, HybridCacheEntryOptions, IEnumerable<String>, CancellationToken)

Asynchronously gets the value associated with the key if it exists, or generates a new entry using the provided key and a value from the given factory if the key is not found.

RemoveAsync(IEnumerable<String>, CancellationToken)

Asynchronously removes the value associated with the key if it exists.

RemoveAsync(String, CancellationToken)

Asynchronously removes the value associated with the key if it exists.

RemoveByTagAsync(IEnumerable<String>, CancellationToken)

Asynchronously removes all values associated with the specified tags.

RemoveByTagAsync(String, CancellationToken)

Asynchronously removes all values associated with the specified tag.

SetAsync<T>(String, T, HybridCacheEntryOptions, IEnumerable<String>, CancellationToken)

Asynchronously sets or overwrites the value associated with the key.

Applies to

Produk Versi
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)