Interface that must be implemented by classes that need to be used as cache dependencies, for use with the AddDependency(ICachingService, ICacheDependency) method. Alternatively, custom classes may implement the IFormattable<T> interface or simply the ToString() method.
Namespace: Metalama.Patterns.Caching.Dependencies
Assembly: Metalama.Patterns.Caching.dll
Syntax
public interface ICacheDependencyRemarks
Cache dependencies provide an indirect way to invalidate cache items. Instead of directly invalidating a specific cached method, you can invalidate a dependency, which automatically invalidates all cache items that depend on it.
Dependencies are added to the current caching context using the AddDependency(ICachingService, ICacheDependency) method and invalidated using the Invalidate(ICachingService, ICacheDependency) method.
Properties
| Name | Description |
|---|---|
| CascadeDependencies | Gets the list of dependencies that must also be invalidated when the current dependency is invalidated. |
Methods
| Name | Description |
|---|---|
| GetCacheKey(ICachingService) | Gets a string that uniquely represents the current object. |