コード例 #1
0
        /// <summary>
        /// 更新缓存
        /// </summary>
        /// <param name="key"></param>
        /// <param name="instance"></param>
        public static bool Update(string key, object instance, object historyInstance)
        {
            bool result;

            if (CacheValidate.CacheDataValidate(instance, historyInstance))
            {
                cache.Update(key, instance);
                result = true;
            }
            else
            {
                result = false;
            }
            return(result);
        }
コード例 #2
0
        /// <summary>
        /// 更新缓存
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="absoluteExpiration"></param>
        /// <param name="slidingExpiration"></param>
        public static bool Update(string key, object instance, DateTime?absoluteExpiration, TimeSpan?slidingExpiration, object historyInstance)
        {
            bool result;

            if (CacheValidate.CacheDataValidate(instance, historyInstance))
            {
                cache.Update(key, instance, absoluteExpiration, slidingExpiration);
                result = true;
            }
            else
            {
                result = false;
            }
            return(result);
        }