ObjectDependency(object)
Wraps an object into an ICacheDependency. The GetCacheKey(ICachingService) method relies on the KeyBuilder to create the cache key of the wrapped object.
Declaration
public ObjectDependency(object Object)Parameters
| Type | Name | Description |
|---|---|---|
| object | Object | The object to wrap as a cache dependency. |
Remarks
Use this class when you have objects that already implement cache key generation (through
the CacheKeyAttribute aspect or a custom formatter) and want to use them as dependencies.
Alternatively, you can use the AddObjectDependency(ICachingService, object) and InvalidateObject(ICachingService, object) extension methods to avoid creating wrapper objects.