Example #1
0
        /// <summary>
        /// 清除特殊车型附加安装费服务缓存
        /// </summary>
        /// <returns></returns>
        public bool RefreshVehicleAdditionalPriceCache()
        {
            var key  = "VehicleAdditionalPriceSwitch";
            var keys = new List <string>()
            {
                key
            };

            using (var client = new Tuhu.Service.Shop.CacheClient())
            {
                var cacheResult = client.RemoveCaches(keys);
                cacheResult.ThrowIfException(true);
                return(cacheResult.Result);
            }
        }
Example #2
0
        /// <summary>
        /// 刷新保养项目加价服务缓存
        /// </summary>
        /// <returns></returns>
        public bool RefreshBaoYangInstallFeeConfigCache()
        {
            var result = true;

            try
            {
                var serviceIds = GetAllBaoYangServices();
                if (serviceIds != null && serviceIds.Any())
                {
                    var keys = serviceIds.Select(s => $"ServicePrice/BaoYangInstallFeeConfig/{s.ServiceId}");
                    using (var client = new Tuhu.Service.Shop.CacheClient())
                    {
                        var cacheResult = client.RemoveCaches(keys);
                        cacheResult.ThrowIfException(true);
                        result = cacheResult.Result;
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Error("RefreshBaoYangInstallFeeConfigCache", ex);
            }
            return(result);
        }