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

CachingBackend.ContainsItemAsync Method

ContainsItemAsync(String, CancellationToken)

Asynchronously determines whether the cache contains an item of a given key.

Declaration
public ValueTask<bool> ContainsItemAsync(string key, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.String key

The key of the cache item.

System.Threading.CancellationToken cancellationToken

A System.Threading.CancellationToken.

Returns
Type Description
System.Threading.Tasks.ValueTask<System.Boolean>

A System.Threading.Tasks.Task that evaluates to true if the cache contains an item whose key is key, otherwise false.