Exemplo n.º 1
0
        /// <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));
        }
Exemplo n.º 2
0
 /// <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)));
 }
Exemplo n.º 3
0
 /// <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)));
 }