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 |
Examples
Example sets key dependency of a cache item
Product product = new Product();
product.Id = 1;
product.Name = "Chai";
CacheItem item = new CacheItem(product);
item.Dependency = new KeyDependency("Product1");