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; } }
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; } }