示例#1
0
        public static void ProcessScheduleRuleAction(CacheBehavior cacheBehavior, CacheAction cacheAction)
        {
            // Step 1. Get cache key
            string cacheKey = cacheBehavior.GetCacheKey(cacheAction.Item);

            // Step 2. Get cache value
            CacheListContainer <ScheduleRule> scheduleRuleListContainer = CacheHelper2.GetCacheValue <CacheListContainer <ScheduleRule> >(cacheKey);

            if (scheduleRuleListContainer == null)
            {
                return;
            }

            // Step 3. Process
            if (cacheAction.CacheActionType == CacheActionTypes.Insert)
            {
                scheduleRuleListContainer.Put((ScheduleRule)cacheAction.Item);
            }
            else if (cacheAction.CacheActionType == CacheActionTypes.Update)
            {
                scheduleRuleListContainer.Put((ScheduleRule)cacheAction.Item);
            }
            else if (cacheAction.CacheActionType == CacheActionTypes.Delete)
            {
                scheduleRuleListContainer.Delete(((ScheduleRule)cacheAction.Item).Id);
            }
        }
示例#2
0
        public static void ProcessProviderAction(CacheBehavior cacheBehavior, CacheAction cacheAction)
        {
            // Step 1. Get cache key
            string cacheKey = cacheBehavior.GetCacheKey(cacheAction.Item);

            // Step 2. Get cache value
            CacheItemContainer <Provider> providerContainer = CacheHelper2.GetCacheValue <CacheItemContainer <Provider> >(cacheKey);

            if (providerContainer == null)
            {
                return;
            }

            // Step 3. Refresh
            Provider provider = new GetProvider()
            {
                Id = providerContainer.Item.Id
            }.ExecuteItem(false);

            providerContainer.Item = provider;
        }
示例#3
0
 public static void ProcessPetLinkAction(CacheBehavior cacheBehavior, CacheAction cacheAction)
 {
 }