//Create a Primary Memory Cache with a backing File Cache
string directory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "KellermanSoftware", "NetCachingLibrary", "Tests");
SmartConfig config = new SmartConfig(new MemoryCacheProvider(), new FileCacheProvider(directory));
//Specify UserName and LicenseKey for Licensed Mode
//config.UserName = "my user name";
//config.LicenseKey = "my license key";
//Instantiate the cache
SmartCache cache = new SmartCache(config);
//Build parameters for the report
int month = DateTime.Now.Month;
int year = DateTime.Now.Year;
//Get the cache key based on the report parameters
string cacheKey = cache.BuildCacheKey("MonthlySalesReport", month, year);
//Get a long running report
List<ReportDetail> report = ReportLogic.MonthlySalesReport(month, year);
//Save to the cache
cache.Set< List<ReportDetail>>(cacheKey, report);
//Remove it from the cache
var result = cache.Remove<List<ReportDetail>>(cacheKey);
bool found = cache.Contains(cacheKey);
//This will be false
Console.WriteLine(found);