Example #1
0
        public virtual bool AddItem <T>(T item) where T : class, IId
        {
            // Step 1. Get Cache
            Cache cache = CacheHelper2.GetCache();

            if (cache == null)
            {
                return(false);
            }

            // Step 2.
            string cacheKey = this.GetCacheKey(item);

            // Step 3.
            switch (this.CacheType)
            {
            case CacheTypes.Item:
                var itemContainer = CacheHelper2.GetCacheValue <CacheItemContainer <T> >(cacheKey);
                itemContainer.Refresh();
                break;

            case CacheTypes.ItemList:
                var listContainer = CacheHelper2.GetCacheValue <CacheListContainer <T> >(cacheKey);
                listContainer.Put(item);
                break;
            }

            return(false);
        }
Example #2
0
        public virtual bool DeleteItem(object item)
        {
            // Step 1. Get Cache
            Cache cache = CacheHelper2.GetCache();

            if (cache == null)
            {
                return(false);
            }

            return(false);
        }