Example #1
0
        private void InsertCache(string key, object content, int lifeSpanSecs)
        {
            if (content == null) return;

            lock (_cacheTable.SyncRoot)
            {
                CacheItem item = new CacheItem();
                item.Key = key;
                item.Content = content;
                item.LifeSpanSecs = lifeSpanSecs;
                _cacheTable[key] = content;
            }
        }
Example #2
0
        public static void SetCache(string cacheKey, object cacheData, int lifeSpanSecs)
        {
            if (cacheData == null) return;

            lock (_cacheTable.SyncRoot)
            {
                CacheItem item = new CacheItem();
                item.Key = cacheKey;
                item.Content = cacheData;
                item.LifeSpanSecs = lifeSpanSecs;
                _cacheTable[cacheKey] = item;
            }
        }