Beispiel #1
0
        /// <summary>
        /// Removes workflowActionForm from cache
        /// </summary>
        /// <param name="id"></param>
        public static void Flush(int id)
        {
            var actionForm = WorkflowActionFormCache.Read(id);

            if (actionForm != null)
            {
                foreach (var formAttribute in actionForm.FormAttributes)
                {
                    WorkflowActionFormAttributeCache.Flush(formAttribute.Id);
                }
            }
            FlushCache(WorkflowActionFormCache.CacheKey(id));
        }
        /// <summary>
        /// Removes a WorkflowActionForm from cache.
        /// </summary>
        /// <param name="id">The identifier.</param>
        public new static void Remove(int id)
        {
            var actionForm = Get(id);

            if (actionForm != null)
            {
                foreach (var formAttribute in actionForm.FormAttributes)
                {
                    WorkflowActionFormAttributeCache.Remove(formAttribute.Id);
                }
            }

            Remove(id.ToString());
        }
 /// <summary>
 /// Removes workflowActionFormAttribute from cache
 /// </summary>
 /// <param name="id"></param>
 public static void Flush(int id)
 {
     FlushCache(WorkflowActionFormAttributeCache.CacheKey(id));
 }
 /// <summary>
 /// Reads the specified defined type model.
 /// </summary>
 /// <param name="workflowActionFormAttributeModel">The defined type model.</param>
 /// <param name="rockContext">The rock context.</param>
 /// <returns></returns>
 public static WorkflowActionFormAttributeCache Read(WorkflowActionFormAttribute workflowActionFormAttributeModel, RockContext rockContext = null)
 {
     return(GetOrAddExisting(WorkflowActionFormAttributeCache.CacheKey(workflowActionFormAttributeModel.Id),
                             () => LoadByModel(workflowActionFormAttributeModel)));
 }
 /// <summary>
 /// Returns WorkflowActionFormAttribute object from cache.  If workflowActionFormAttribute 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 WorkflowActionFormAttributeCache Read(int id, RockContext rockContext = null)
 {
     return(GetOrAddExisting(WorkflowActionFormAttributeCache.CacheKey(id),
                             () => LoadById(id, rockContext)));
 }