NCache 4.6 - Online Documentation

Adding Data Group with CacheItem

 
In this example data group is set by assigning it as a property of CacheItem in NCache.
 
      To utilize the following APIs, include the following namespace in your application: Alachisoft.NCache.Web.Caching.
 
        Product product = new Product();
        product.ProductID = 1001;
        product.ProductName = "Chai";
        string key = "Product:" + product.ProductID;
 
        CacheItem cacheItem = new CacheItem(product);
        cacheItem.Group = "Product";
        cacheItem.SubGroup = "Beverages";
 
        try
        {
            cache.Add(key, cacheItem);
        }
        catch (Exception ex)
        {
            // handle exception
        }
 
 
See Also