Class CacheDependency
Tracks cache dependencies, which can be files, directories, or keys to other objects in application's cache. This class cannot be inherited.
Inheritance
Assembly: Alachisoft.NCache.Runtime.dll
Syntax
[Serializable]
public class CacheDependency : IDisposable
Remarks
You can add items with dependencies to your application's cache with the Add and Insert methods.
When you add an item to an application's cache object and, in doing so, define a cache dependency for that item, an instance of the CacheDependency class is created automatically to track changes to the files, keys, or directories you have specified. This helps you avoid losing changes made to the object between the time it is created and the time it is inserted into the cache. The CacheDependency instance can represent a single file or directory, an array of files or directories, or an array of files or directories along with an array of cache keys (these represent other items stored in the cache object).
Constructors
Name | Description |
---|---|
Cache |
Default constructor for Cache |
Cache |
Creates a Cache |
Cache |
Creates a Cache |
Cache |
Initializes a new instance of the Cache |
Cache |
Initializes a new instance of the Cache |
Cache |
Initializes a new instance of the CacheDependency class that monitors an array of file paths (to files or directories) for changes. |
Cache |
Initializes a new instance of the Cache |
Cache |
Initializes a new instance of the Cache |
Cache |
Initializes a new instance of the Cache |
Cache |
Initializes a new instance of the Cache |
Cache |
Initializes a new instance of the Cache |
Properties
Name | Description |
---|---|
Dependencies | Contains the list of dependencies for the cache item. |
Methods
Name | Description |
---|---|
Add |
This method is used to add dependencies for the cache item. |
Dependency |
Releases custom resources used by the Cache |
Dispose() | Releases the resources used by the Cache |