/// <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)); }
/// <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))); }
/// <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))); }