MetalamaAPI documentationPatterns APIMetalama.​Patterns.​CachingCaching­Service­Extensions
Open sandboxFocus

CachingServiceExtensions Class

Extension methods for the ICachingService interface.

Inheritance
System.Object
CachingServiceExtensions
Namespace: Metalama.Patterns.Caching
Assembly: Metalama.Patterns.Caching.dll
Syntax
public static class CachingServiceExtensions : Object

Methods

Name Description
AddDependencies(ICachingService, IEnumerable<ICacheDependency>)
AddDependencies(ICachingService, IEnumerable<String>)
AddDependency(ICachingService, ICacheDependency)
AddDependency(ICachingService, String)
AddObjectDependency(ICachingService, Object)
Invalidate(ICachingService, ICacheDependency)

Invalidates a cache dependency given as an ICacheDependency, i.e. removes all cache items that are dependent on this dependency.

Invalidate(ICachingService, IReadOnlyCollection<String>)

Invalidates a set of cache dependencies given as System.String, i.e. removes all cache items that are dependent on these dependency keys.

Invalidate(ICachingService, MethodInfo, Object, Object[])

Removes a method call result from the cache giving the System.Reflection.MethodInfo representing the method, the instance and the arguments of the method call.

Invalidate(ICachingService, String)

Invalidates a cache dependency given as System.String, i.e. removes all cache items that are dependent on this dependency key.

Invalidate(ICachingService, String, String[])
Invalidate<TReturn>(ICachingService, Func<TReturn>)

Removes a method call result from the cache giving the delegate of the method. This overload is for methods with 0 parameter.

Invalidate<TReturn, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TReturn>, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9)

Removes a method call result from the cache giving the delegate of the method. This overload is for methods with 9 parameters.

Invalidate<TReturn, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TReturn>, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10)

Removes a method call result from the cache giving the delegate of the method. This overload is for methods with 10 parameters.

Invalidate<TReturn, TParam1>(ICachingService, Func<TParam1, TReturn>, TParam1)

Removes a method call result from the cache giving the delegate of the method. This overload is for methods with 1 parameter.

Invalidate<TReturn, TParam1, TParam2>(ICachingService, Func<TParam1, TParam2, TReturn>, TParam1, TParam2)

Removes a method call result from the cache giving the delegate of the method. This overload is for methods with 2 parameters.

Invalidate<TReturn, TParam1, TParam2, TParam3>(ICachingService, Func<TParam1, TParam2, TParam3, TReturn>, TParam1, TParam2, TParam3)

Removes a method call result from the cache giving the delegate of the method. This overload is for methods with 3 parameters.

Invalidate<TReturn, TParam1, TParam2, TParam3, TParam4>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TReturn>, TParam1, TParam2, TParam3, TParam4)

Removes a method call result from the cache giving the delegate of the method. This overload is for methods with 4 parameters.

Invalidate<TReturn, TParam1, TParam2, TParam3, TParam4, TParam5>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TParam5, TReturn>, TParam1, TParam2, TParam3, TParam4, TParam5)

Removes a method call result from the cache giving the delegate of the method. This overload is for methods with 5 parameters.

Invalidate<TReturn, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TReturn>, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6)

Removes a method call result from the cache giving the delegate of the method. This overload is for methods with 6 parameters.

Invalidate<TReturn, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TReturn>, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7)

Removes a method call result from the cache giving the delegate of the method. This overload is for methods with 7 parameters.

Invalidate<TReturn, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TReturn>, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8)

Removes a method call result from the cache giving the delegate of the method. This overload is for methods with 8 parameters.

InvalidateAsync(ICachingService, ICacheDependency, CancellationToken)

Asynchronously invalidates a cache dependency given as an ICacheDependency, i.e. removes all cache items that are dependent on this dependency.

InvalidateAsync(ICachingService, IReadOnlyCollection<String>, CancellationToken)

Asynchronously invalidates a cache dependency given as System.String, i.e. removes all cache items that are dependent on this dependency key.

InvalidateAsync(ICachingService, MethodInfo, Object, Object[], CancellationToken)

Asynchronously removes a method call result from the cache giving the System.Reflection.MethodInfo representing the method, the instance and the arguments of the method call.

InvalidateAsync(ICachingService, String, String[])
InvalidateAsync(ICachingService, String, CancellationToken)

Asynchronously invalidates a cache dependency given as System.String, i.e. removes all cache items that are dependent on this dependency key.

InvalidateAsync<TReturn>(ICachingService, Func<TReturn>, CancellationToken)

Asynchronously removes a method call result from the cache giving the delegate of the method. This overload is for methods with 0 parameter.

InvalidateAsync<TReturn, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TReturn>, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, CancellationToken)

Asynchronously removes a method call result from the cache giving the delegate of the method. This overload is for methods with 9 parameters.

InvalidateAsync<TReturn, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TReturn>, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, CancellationToken)

Asynchronously removes a method call result from the cache giving the delegate of the method. This overload is for methods with 10 parameters.

InvalidateAsync<TReturn, TParam1>(ICachingService, Func<TParam1, TReturn>, TParam1, CancellationToken)

Asynchronously removes a method call result from the cache giving the delegate of the method. This overload is for methods with 1 parameter.

InvalidateAsync<TReturn, TParam1, TParam2>(ICachingService, Func<TParam1, TParam2, TReturn>, TParam1, TParam2, CancellationToken)

Asynchronously removes a method call result from the cache giving the delegate of the method. This overload is for methods with 2 parameters.

InvalidateAsync<TReturn, TParam1, TParam2, TParam3>(ICachingService, Func<TParam1, TParam2, TParam3, TReturn>, TParam1, TParam2, TParam3, CancellationToken)

Asynchronously removes a method call result from the cache giving the delegate of the method. This overload is for methods with 3 parameters.

InvalidateAsync<TReturn, TParam1, TParam2, TParam3, TParam4>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TReturn>, TParam1, TParam2, TParam3, TParam4, CancellationToken)

Asynchronously removes a method call result from the cache giving the delegate of the method. This overload is for methods with 4 parameters.

InvalidateAsync<TReturn, TParam1, TParam2, TParam3, TParam4, TParam5>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TParam5, TReturn>, TParam1, TParam2, TParam3, TParam4, TParam5, CancellationToken)

Asynchronously removes a method call result from the cache giving the delegate of the method. This overload is for methods with 5 parameters.

InvalidateAsync<TReturn, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TReturn>, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, CancellationToken)

Asynchronously removes a method call result from the cache giving the delegate of the method. This overload is for methods with 6 parameters.

InvalidateAsync<TReturn, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TReturn>, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, CancellationToken)

Asynchronously removes a method call result from the cache giving the delegate of the method. This overload is for methods with 7 parameters.

InvalidateAsync<TReturn, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TReturn>, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, CancellationToken)

Asynchronously removes a method call result from the cache giving the delegate of the method. This overload is for methods with 8 parameters.

InvalidateObject(ICachingService, Object)

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>, System.Object.ToString or ISpanFormattable.

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>, System.Object.ToString or ISpanFormattable.

Refresh<TReturn>(ICachingService, Func<TReturn>)

Evaluates a method, ignoring the currently cached value, and replaces the corresponding cache item with the new return value of the method. This overload is for methods with 0 parameter.

Refresh<TReturn, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TReturn>, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9)

Evaluates a method, ignoring the currently cached value, and replaces the corresponding cache item with the new return value of the method. This overload is for methods with 9 parameters.

Refresh<TReturn, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, TReturn>, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10)

Evaluates a method, ignoring the currently cached value, and replaces the corresponding cache item with the new return value of the method. This overload is for methods with 10 parameters.

Refresh<TReturn, TParam1>(ICachingService, Func<TParam1, TReturn>, TParam1)

Evaluates a method, ignoring the currently cached value, and replaces the corresponding cache item with the new return value of the method. This overload is for methods with 1 parameter.

Refresh<TReturn, TParam1, TParam2>(ICachingService, Func<TParam1, TParam2, TReturn>, TParam1, TParam2)

Evaluates a method, ignoring the currently cached value, and replaces the corresponding cache item with the new return value of the method. This overload is for methods with 2 parameters.

Refresh<TReturn, TParam1, TParam2, TParam3>(ICachingService, Func<TParam1, TParam2, TParam3, TReturn>, TParam1, TParam2, TParam3)

Evaluates a method, ignoring the currently cached value, and replaces the corresponding cache item with the new return value of the method. This overload is for methods with 3 parameters.

Refresh<TReturn, TParam1, TParam2, TParam3, TParam4>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TReturn>, TParam1, TParam2, TParam3, TParam4)

Evaluates a method, ignoring the currently cached value, and replaces the corresponding cache item with the new return value of the method. This overload is for methods with 4 parameters.

Refresh<TReturn, TParam1, TParam2, TParam3, TParam4, TParam5>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TParam5, TReturn>, TParam1, TParam2, TParam3, TParam4, TParam5)

Evaluates a method, ignoring the currently cached value, and replaces the corresponding cache item with the new return value of the method. This overload is for methods with 5 parameters.

Refresh<TReturn, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TReturn>, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6)

Evaluates a method, ignoring the currently cached value, and replaces the corresponding cache item with the new return value of the method. This overload is for methods with 6 parameters.

Refresh<TReturn, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TReturn>, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7)

Evaluates a method, ignoring the currently cached value, and replaces the corresponding cache item with the new return value of the method. This overload is for methods with 7 parameters.

Refresh<TReturn, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TReturn>, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8)

Evaluates a method, ignoring the currently cached value, and replaces the corresponding cache item with the new return value of the method. This overload is for methods with 8 parameters.

RefreshAsync<TReturn>(ICachingService, Func<Task<TReturn>>, CancellationToken)

Asynchronously evaluates a method, ignoring the currently cached value, and replaces the corresponding cache item with the new return value of the method. This overload is for methods with 0 parameter.

RefreshAsync<TReturn, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, Task<TReturn>>, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, CancellationToken)

Asynchronously evaluates a method, ignoring the currently cached value, and replaces the corresponding cache item with the new return value of the method. This overload is for methods with 9 parameters.

RefreshAsync<TReturn, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, Task<TReturn>>, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, TParam9, TParam10, CancellationToken)

Asynchronously evaluates a method, ignoring the currently cached value, and replaces the corresponding cache item with the new return value of the method. This overload is for methods with 10 parameters.

RefreshAsync<TReturn, TParam1>(ICachingService, Func<TParam1, Task<TReturn>>, TParam1, CancellationToken)

Asynchronously evaluates a method, ignoring the currently cached value, and replaces the corresponding cache item with the new return value of the method. This overload is for methods with 1 parameter.

RefreshAsync<TReturn, TParam1, TParam2>(ICachingService, Func<TParam1, TParam2, Task<TReturn>>, TParam1, TParam2, CancellationToken)

Asynchronously evaluates a method, ignoring the currently cached value, and replaces the corresponding cache item with the new return value of the method. This overload is for methods with 2 parameters.

RefreshAsync<TReturn, TParam1, TParam2, TParam3>(ICachingService, Func<TParam1, TParam2, TParam3, Task<TReturn>>, TParam1, TParam2, TParam3, CancellationToken)

Asynchronously evaluates a method, ignoring the currently cached value, and replaces the corresponding cache item with the new return value of the method. This overload is for methods with 3 parameters.

RefreshAsync<TReturn, TParam1, TParam2, TParam3, TParam4>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, Task<TReturn>>, TParam1, TParam2, TParam3, TParam4, CancellationToken)

Asynchronously evaluates a method, ignoring the currently cached value, and replaces the corresponding cache item with the new return value of the method. This overload is for methods with 4 parameters.

RefreshAsync<TReturn, TParam1, TParam2, TParam3, TParam4, TParam5>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TParam5, Task<TReturn>>, TParam1, TParam2, TParam3, TParam4, TParam5, CancellationToken)

Asynchronously evaluates a method, ignoring the currently cached value, and replaces the corresponding cache item with the new return value of the method. This overload is for methods with 5 parameters.

RefreshAsync<TReturn, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, Task<TReturn>>, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, CancellationToken)

Asynchronously evaluates a method, ignoring the currently cached value, and replaces the corresponding cache item with the new return value of the method. This overload is for methods with 6 parameters.

RefreshAsync<TReturn, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, Task<TReturn>>, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, CancellationToken)

Asynchronously evaluates a method, ignoring the currently cached value, and replaces the corresponding cache item with the new return value of the method. This overload is for methods with 7 parameters.

RefreshAsync<TReturn, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8>(ICachingService, Func<TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, Task<TReturn>>, TParam1, TParam2, TParam3, TParam4, TParam5, TParam6, TParam7, TParam8, CancellationToken)

Asynchronously evaluates a method, ignoring the currently cached value, and replaces the corresponding cache item with the new return value of the method. This overload is for methods with 8 parameters.

SuspendDependencyPropagation(ICachingService)

Temporarily suspends propagation of dependencies from subsequently called methods to the caller method.