/*
 *              private void Insert(string key, object obj, CacheDependency dep, DateTimeOffset timeframeOffset, CacheItemPriority priority, CacheItemRemovedCallback callback)
 *              {
 *                      if (obj != null)
 *                      {
 *                              var cache = GetCache();
 *                              cache.Insert(key, obj, dep, timeframeOffset.UtcDateTime, Cache.NoSlidingExpiration, priority, callback);
 *                      }
 *              }
 */

        /// <summary>
        /// Items the removed callback.
        /// </summary>
        /// <param name="key">The key.</param>
        /// <param name="value">The value.</param>
        /// <param name="reason">The reason.</param>
        internal static void ItemRemovedCallback(string key, object value, CacheItemRemovedReason reason)
        {
            if (reason == CacheItemRemovedReason.Expired)
            {
                var cacheEntry = CacheEntries.Get(key);

                if (cacheEntry != null)
                {
                    lock (cacheEntry.Lock)
                    {
                        CacheEntries.Remove(key);
                    }
                }
            }
        }