예제 #1
0
        /// <summary>
        /// Removes workflowActivityType from cache
        /// </summary>
        /// <param name="id"></param>
        public static void Flush(int id)
        {
            var activityType = WorkflowActivityTypeCache.Read(id);

            if (activityType != null)
            {
                foreach (var actionType in activityType.ActionTypes)
                {
                    WorkflowActionTypeCache.Flush(actionType.Id);
                }
            }
            FlushCache(WorkflowActivityTypeCache.CacheKey(id));
        }
예제 #2
0
 /// <summary>
 /// Reads the specified defined type model.
 /// </summary>
 /// <param name="workflowActivityTypeModel">The defined type model.</param>
 /// <param name="rockContext">The rock context.</param>
 /// <returns></returns>
 public static WorkflowActivityTypeCache Read(WorkflowActivityType workflowActivityTypeModel, RockContext rockContext = null)
 {
     return(GetOrAddExisting(WorkflowActivityTypeCache.CacheKey(workflowActivityTypeModel.Id),
                             () => LoadByModel(workflowActivityTypeModel)));
 }
예제 #3
0
 /// <summary>
 /// Returns WorkflowActivityType object from cache.  If workflowActivityType does not already exist in cache, it
 /// will be read and added to cache
 /// </summary>
 /// <param name="id">The identifier.</param>
 /// <param name="rockContext">The rock context.</param>
 /// <returns></returns>
 public static WorkflowActivityTypeCache Read(int id, RockContext rockContext = null)
 {
     return(GetOrAddExisting(WorkflowActivityTypeCache.CacheKey(id),
                             () => LoadById(id, rockContext)));
 }