Open sandboxFocus

Method InvalidateObjectAsync

InvalidateObjectAsync(ICachingService, object, CancellationToken)

Asynchronously invalidates a cache dependency given an object, i.e. removes all cached items that are dependent on that object. The cache key is generated from the object using the same mechanism as with parameters, i.e. using IFormattable<T>, Formatter<T>, ToString() or ISpanFormattable.

Declaration
public static ValueTask InvalidateObjectAsync(this ICachingService cachingService, object dependency, CancellationToken cancellationToken = default)
Parameters
Type Name Description
ICachingService cachingService

The ICachingService.

object dependency
CancellationToken cancellationToken
Returns
Type Description
ValueTask

A Task.