Custom Dependency

NOTE: This feature is not available in NCache Express and Professional edition.

You can have your own custom dependencies. In this way, you can expire items from the cache in a number of flexible ways where your own expiration logic meets your business requirements. NCache provides an abstract class ExtensibleDependency that is the base for all the dependencies. All you need to do is to inherit your dependency class from this class and override its HasChanged property. The following sample code creates a new dependency. The dependency polls the Northwind database and expires all the Products for which units in stock are less than 100.