private Dictionary <int, string> GetDictionaryFromCache(TestCacheItem testCacheItem, int numberOfItems) { Trace.WriteLine("Method call: GetDictionaryFromCache(TestCacheItem, int)"); return(SlimCacheManager.LoadFromCache <Dictionary <int, string> >( testCacheItem.ToString() , delegate { return GetHugeDictionary(numberOfItems); })); }
private SimpleObject GetCacheItem(int index) { return(SlimCacheManager.LoadFromCache <SimpleObject>( "TestItem" , delegate { Trace.WriteLine("DELEGATE CALL TO: ___START___ GetCacheItem, INDEX: " + index); Thread.Sleep(200); Trace.WriteLine("DELEGATE CALL TO: ___FINISH___ GetCacheItem, INDEX: " + index); return new SimpleObject() { MyString = "________" + index + "_________________________________________________ " + DateTime.UtcNow.ToString("HH:mm:ss.fff"), MyValue = index }; })); }
private SimpleObject GetCacheItem2() { Trace.WriteLine("*************** GetCacheItem2 call at: " + DateTime.UtcNow.ToString("HH:mm:ss.fff") + " ******************"); return(SlimCacheManager.LoadFromCache <SimpleObject>( "TestItem2" , delegate { Trace.WriteLine("DELEGATE CALL TO: ___FINISH___ GetCacheItem2"); return new SimpleObject() { MyString = "_________________________________________________________ " + DateTime.UtcNow.ToString("HH:mm:ss.fff") , MyValue = 0 }; })); }