Property Dependency
Dependency
The file or cache key dependencies for the item. When any dependency changes, the object becomes invalid and is removed from the cache. If there are no dependencies, this property contains a null reference.
Declaration
public CacheDependency Dependency { get; set; }
Property Value
Type | Description |
---|---|
CacheDependency | This property tracks cache dependencies, which can be files, directories, or keys to other objects in an application cache. |
Examples
The following example sets a key dependency of a CacheItem.
Product product = new Product();
product.Id = 1;
product.Name = "Chai";
CacheItem item = new CacheItem(product);
item.Dependency = new KeyDependency("Product1");