示例#1
0
 internal static void InsertIntoCache(UserContext userContext)
 {
     UserContextManager.UserContextCacheWrapper userContextCacheWrapper = (UserContextManager.UserContextCacheWrapper)HttpRuntime.Cache.Get(userContext.Key.ToString());
     if (userContextCacheWrapper == null)
     {
         userContextCacheWrapper = new UserContextManager.UserContextCacheWrapper();
     }
     userContextCacheWrapper.UserContext = userContext;
     HttpRuntime.Cache.Insert(userContext.Key.ToString(), userContextCacheWrapper, null, DateTime.MaxValue, new TimeSpan(userContext.CalculateTimeout() * 10000L), CacheItemPriority.NotRemovable, new CacheItemRemovedCallback(UserContextManager.UserContextRemovedCallback));
 }