Alachisoft NCache 4.1 - Online Documentation

Cache Provider for .Net 4.0

 
NCache provides integration with .NET cache provider 4.0. You can use ObjectCache implementation with your cache by referring the Cache Provider assembly from the following path:
 
Installed Directory/NCache/integration/DotNet4.0 Cache Provider
 
NCache provider gives you the support for all the properties of ObjectCache class except "regions".
 
Configuration Steps:
 
Following steps need to be followed for using cache provides in your application:
 
  • Create a new Clustered Cache or a Local Cache in NCache Manager with the name "mycache".
  • Start the cache "mycache".
  • Create an application inside Visual Studio.NET.
  • Add following references to your application from "Installed Directory/NCache/integration/DotNet4.0 Cache Provider" path:
    Alachisoft.NCache.ObjectCacheProvider
     
  • Include the following namespace in your project.
     
    using Alachisoft.NCache.ObjectCacheProvider;
     
  • Initialize your CacheProvider and pass your cache name to the provider as shown below.
     
    private ObjectCache _cache;
    private string _cacheId = "myCache" ;
    _cache = new CacheProvider(_cacheId);
     
  • Now you can perform all cache related operations on your cache using CacheProvider commands.
 
 
See Also
 
Copyright © 2005-2012 Alachisoft. All rights reserved.