Front-end interface used by the caching aspects.
Namespace: Metalama.Patterns.Caching
Assembly: Metalama.Patterns.Caching.dll
Syntax
public interface ICachingService : IAsyncDisposable, IDisposable
Properties
Name | Description |
---|---|
AllBackends | |
KeyBuilder | |
Logger |
Methods
Name | Description |
---|---|
GetFromCacheOrExecuteTaskAsync<TTaskResultType>(CachedMethodMetadata, object?, object?[], Func<object?, object?[], CancellationToken, Task<object?>>, CacheItemConfiguration?, CancellationToken) | |
GetFromCacheOrExecuteValueTaskAsync<TTaskResultType>(CachedMethodMetadata, object?, object?[], Func<object?, object?[], CancellationToken, ValueTask<object?>>, CacheItemConfiguration?, CancellationToken) | |
GetFromCacheOrExecute<TResult>(CachedMethodMetadata, object?, object?[], Func<object?, object?[], object?>, CacheItemConfiguration?, CancellationToken) | |
InitializeAsync(CancellationToken) | Initializes the caching service. It is recommended to call this method from the start-up program sequence when the back-end involves a network or out-of-process service (e.g. Redis, Azure). If this method is not called, initialization will occur automatically upon the first call any cached method. |
Extension Methods
CachingServiceExtensions.InvalidateAsync<TReturn>(ICachingService, Func<TReturn>, CancellationToken)