コード例 #1
0
        public void Remove()
        {
            string testString = "test";

            _cache.Add(testString, "test", 1000);

            _cache.Remove("test");

            Assert.AreEqual(false, _cache.Contains("test"));
        }
コード例 #2
0
        /// <summary>
        /// Release the current session state data from memory.
        /// </summary>
        public static void ReleaseAll()
        {
            if (UserOnlineController.CurrentUser != null)
            {
                // Cleanup the cuurrent session state data
                // from the cache.
                MemberInfo memberInfo = new MemberInfo();
                memberInfo.UniqueHashcode   = UserOnlineController.CurrentUser.UniqueHashcode;
                memberInfo.UserIdentityName = UserOnlineController.CurrentUser.UserIdentityName;
                RuntimeCache.Remove(UserOnlineController.CurrentUser.UniqueHashcode);
                RemoveUserFromCache(memberInfo);
            }

            // Cleanup the current session state.
            UserOnlineController.CurrentUser = null;
        }
コード例 #3
0
 /// <summary>
 /// Remove the item from the runtime cache.
 /// </summary>
 /// <param name="memberInfo">The member info type containing the data.</param>
 internal static void RemoveUserFromCache(MemberInfo memberInfo)
 {
     RuntimeCache.Remove(memberInfo.UniqueHashcode);
 }