Пример #1
0
        public T GetWithMultipleKey <T>(params string[] _pKey)
            where T : class
        {
            string findkey = new cacheParam <T>(_pKey).ToString();

            return(GetWithMultipleKey <T>(findkey));
        }
Пример #2
0
        /// <summary>
        /// get data from cachememory
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="_pKey"></param>
        /// <returns></returns>
        public T Get <T>(params string[] _pKey)
            where T : class
        {
            string findkey = new cacheParam <T>(_pKey).ToString();

            try
            {
                return(Get <T>(findkey));
            }
            catch (MemoryCache.MemoryCacheException ex)
            {
                RemoveWithOrginKey(findkey);
                return(null);
            }
        }
Пример #3
0
 public cacheObject(cacheParam <T> pkeybuild, T value, TimeSpan expiry)
 {
     PKey       = pkeybuild.ToString();
     Obj        = value;
     ExpiryTime = expiry;
 }