Open sandboxFocus

Method AddObjectDependency

AddObjectDependency(ICachingService, object)

Adds an object dependency to the current caching context. The cache key is generated from the object using the same mechanism as with method parameters (using the CacheKeyAttribute aspect or formatters).

Declaration
public static void AddObjectDependency(this ICachingService cachingService, object dependency)
Parameters
Type Name Description
ICachingService cachingService

The ICachingService.

object dependency

The object to use as a dependency. Must not be a string or ICacheDependency.

Exceptions
Type Condition
ArgumentOutOfRangeException

When the dependency is a string or ICacheDependency. Use the appropriate overload instead.