NCache 4.6 - Online Documentation

Retrieving Collection from Cache

 
For fetching a collection from cache, use the GetBulk method in NCache. This method returns the collection of items.
 
      To utilize the API, include the following namespace in your application: Alachisoft.NCache.Web.Caching.
 
        string[] keys = { "Product:1001", "Product:1002" };
        try
        {
            IDictionary items = cache.GetBulk(keys, DSReadOption.ReadThru);
 
            if (items.Count > 0)
            {
                IEnumerator iter = items.Values.GetEnumerator();
 
                while (iter.MoveNext())
                {
                    Product info = (Product)iter.Current;
                    //do something
                }
            }
        }
        catch (OperationFailedException ex)
        {
            // handle exception
        }
 
 
See Also