PostSharpAPI ReferencePost­Sharp.​Patterns.​Caching.​ImplementationCaching­BackendGet­Item­Async
Open sandboxFocus

CachingBackend.GetItemAsync Method

GetItemAsync(String, Boolean, CancellationToken)

Asynchronously gets a cache item given its key.

Declaration
public Task<CacheValue> GetItemAsync([Required] string key, bool includeDependencies = true, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.String key

The cache item.

Boolean includeDependencies

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

System.Threading.CancellationToken cancellationToken

A System.Threading.CancellationToken.

Returns
Type Description
Task<CacheValue>

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