/// <summary> /// Removes workflowActionType from cache /// </summary> /// <param name="id"></param> public static void Flush(int id) { var actionType = WorkflowActionTypeCache.Read(id); if (actionType != null && actionType.WorkflowFormId.HasValue) { WorkflowActionFormCache.Flush(actionType.WorkflowFormId.Value); } FlushCache(WorkflowActionTypeCache.CacheKey(id)); }
/// <summary> /// Removes a WorkflowActionForm from cache. /// </summary> /// <param name="id">The identifier.</param> public new static void Remove(int id) { var actionType = Get(id); if (actionType != null && actionType.WorkflowFormId.HasValue) { WorkflowActionFormCache.Remove(actionType.WorkflowFormId.Value); } Remove(id.ToString()); }
/// <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> /// Reads the specified defined type model. /// </summary> /// <param name="workflowActionFormModel">The defined type model.</param> /// <param name="rockContext">The rock context.</param> /// <returns></returns> public static WorkflowActionFormCache Read(WorkflowActionForm workflowActionFormModel, RockContext rockContext = null) { return(GetOrAddExisting(WorkflowActionFormCache.CacheKey(workflowActionFormModel.Id), () => LoadByModel(workflowActionFormModel))); }
/// <summary> /// Returns WorkflowActionForm object from cache. If workflowActionForm 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 WorkflowActionFormCache Read(int id, RockContext rockContext = null) { return(GetOrAddExisting(WorkflowActionFormCache.CacheKey(id), () => LoadById(id, rockContext))); }