/// <summary> /// Removes WorkflowType from cache /// </summary> /// <param name="id"></param> public static void Flush(int id) { var workflowType = WorkflowTypeCache.Read(id); if (workflowType != null) { foreach (var activityType in workflowType.ActivityTypes) { WorkflowActivityTypeCache.Flush(activityType.Id); } } FlushCache(WorkflowTypeCache.CacheKey(id)); }
/// <summary> /// Reads the specified defined type model. /// </summary> /// <param name="WorkflowTypeModel">The defined type model.</param> /// <param name="rockContext">The rock context.</param> /// <returns></returns> public static WorkflowTypeCache Read(WorkflowType WorkflowTypeModel, RockContext rockContext = null) { return(GetOrAddExisting(WorkflowTypeCache.CacheKey(WorkflowTypeModel.Id), () => LoadByModel(WorkflowTypeModel))); }
/// <summary> /// Returns WorkflowType object from cache. If WorkflowType 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 WorkflowTypeCache Read(int id, RockContext rockContext = null) { return(GetOrAddExisting(WorkflowTypeCache.CacheKey(id), () => LoadById(id, rockContext))); }