NCache 4.4 - Online Documentation

Registering Generic Classes using Generic Type Handler

 
NCache also gives you the facility to configure all required generic classes at once using Generic Type Handler. For this, first of all, you have to implement IGenericTypeProvider interface. Write the code for all the required combinations for all data types that can be used in your application. This can be done as follows:
 
Using NCache Manager
 
  • Click on the cache name in Cache Explorer to open cache settings
  • Go to the Compact Serialization tab.
  • Click the Generic Type handler button.
 
 
  • In the Select Compact Classes dialog, click Browse to select the assembly that contains your generic type provider
  class, for which you have implemented the IGenericTypeProvider interface.
  • All of the classes that had the implementation of the IGenericTypeProvider interface will get listed in Class Name drop
  down menu. Select the required generic type provider class from the drop down list.
 
 
  • Click OK. It loads all of the generic classes with their generic types.
 
 
  • Right click the cache in Cache Explorer and select Apply Configuration option.
 
 
 
See Also