/// <summary> /// Add the item to the runtime cache /// </summary> /// <param name="memberInfo">The member info type containing the data.</param> /// <param name="userInfo">The user info type containing the data.</param> internal static void AddUserToCache(MemberInfo memberInfo, UserInfo userInfo) { IHandler handler = new LogHandler(ApplicationName, EventNamespace); double cacheTimeOut = (double)handler.BaseHandlerConfigurationReader.MembershipCacheTimeOut; RuntimeCache.Add(memberInfo.UniqueHashcode, userInfo, cacheTimeOut); }
protected override void SetupBench() { base.SetupBench(); DictionaryCache.Add(Key, Key); DictionaryCache.Add(Key, Key, "region"); RuntimeCache.Add(Key, Key); RuntimeCache.Add(Key, Key, "region"); MsMemoryCache.Add(Key, Key); MsMemoryCache.Add(Key, Key, "region"); MemcachedCache.Add(Key, Key); MemcachedCache.Add(Key, Key, "region"); RedisCache.Add(Key, Key); RedisCache.Add(Key, Key, "region"); }
public void Add_And_Get_String() { string testString = "test"; _cache.Add(testString, "test", 1000); bool found; Assert.AreEqual(testString, _cache.TryGet <string>("test", out found)); Assert.AreEqual(true, found); }