MetalamaAPI documentationPatterns APIMetalama.​Patterns.​CachingCaching­Service­ExtensionsInvalidate­Object­Async
Open sandboxFocus

CachingServiceExtensions.InvalidateObjectAsync Method

InvalidateObjectAsync(ICachingService, Object, CancellationToken)

Asynchronously invalidates a cache dependency given an System.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 = null)
Parameters
Type Name Description
ICachingService cachingService

The ICachingService.

System.Object dependency
System.Threading.CancellationToken cancellationToken
Returns
Type Description
System.Threading.Tasks.ValueTask

A System.Threading.Tasks.Task.