MetalamaAPI documentationPatterns APIMetalama.​Patterns.​Caching.​BackendsCaching­BackendGet­Item­Async
Open sandboxFocus

CachingBackend.GetItemAsync Method

GetItemAsync(String, Boolean, CancellationToken)

Asynchronously gets a cache item given its key.

Declaration
public ValueTask<CacheValue> GetItemAsync(string key, bool includeDependencies = true, CancellationToken cancellationToken = null)
Parameters
Type Name Description
String key

The cache item.

Boolean includeDependencies

true if the Dependencies properties of the resulting CacheValue should be populated, otherwise false.

CancellationToken cancellationToken

A CancellationToken.

Returns
Type Description
ValueTask<CacheValue>

A Task evaluating to a CacheValue, or evaluating to null if there is no item in cache of the given key.