NCache 4.6 - Online Documentation

Registering Generic Classes

NCache also supports generic classes to be compact serialized. Generic classes are configured in the same way as other
classes. In addition we also need to specify <T> types for each Generic class. Generic classes can be configured as folows:
Using NCache Manager
  • Click on the cache name in Cache Explorer to open cache settings.
  • Go to the Compact Serialization tab.
  • Click on the Add Type button. Select Compact Classes dialog appears.
  • Click on the Show Default Generics button. It lists default generic types.
  • Select the desired type and click Add Class.
  • It adds selected classes in the lower pane. Click OK to add classes for Compact Serialization.
  • All of the selected classes are now listed in Compact Serialization tab in NCache Manager.
  • Now you need to specify the classes which you expect to be assigned to the selected generic classes. When you select any of the added generic class, the Add<T> button becomes enabled. Click Add<T>.
  • Select Compact Classes dialog appears. Click Browse to select assembly.
  • All classes will be loaded in Loaded Classes list box.
  • Select your class and click Add Class.
  • Click OK. It adds generic <T> type under the select generic class.
  • This way you can specify as many <T> types for a generic class as needed.
  • Right click on the cache in Cache Explorer and select Apply Configuration option.
See Also