Open sandboxFocus

Class NullCachingService

Inheritance
NullCachingService
Namespace: Metalama.Patterns.Caching
Assembly: Metalama.Patterns.Caching.dll
Syntax
public sealed class NullCachingService : ICachingService, IAsyncDisposable, IDisposable

Properties

Name Description
AllBackends

Gets the collection of all CachingBackend instances used by this service across all profiles.

Instance
KeyBuilder

Gets the ICacheKeyBuilder used to generate cache keys from method arguments.

Logger

Gets the FlashtraceSource used for logging caching operations.

Methods

Name Description
Dispose()
DisposeAsync()
GetFromCacheOrExecuteTaskAsync<TTaskResultType>(CachedMethodMetadata, object?, object?[], Func<object?, object?[], CancellationToken, Task<object?>>, CacheItemConfiguration?, CancellationToken)

Gets a value from the cache or executes an asynchronous method returning Task<TResult> and caches the result. This method is called by the generated code of the CacheAttribute aspect.

GetFromCacheOrExecuteValueTaskAsync<TTaskResultType>(CachedMethodMetadata, object?, object?[], Func<object?, object?[], CancellationToken, ValueTask<object?>>, CacheItemConfiguration?, CancellationToken)

Gets a value from the cache or executes an asynchronous method returning ValueTask<TResult> and caches the result. This method is called by the generated code of the CacheAttribute aspect.

GetFromCacheOrExecute<TResult>(CachedMethodMetadata, object?, object?[], Func<object?, object?[], object?>, CacheItemConfiguration?, CancellationToken)

Gets a value from the cache or executes a synchronous method and caches the result. This method is called by the generated code of the CacheAttribute aspect.

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