/// <summary> /// Adds content channel model to cache, and returns cached object /// </summary> /// <param name="contentChannel"></param> /// <returns></returns> public static ContentChannelCache Read(ContentChannel contentChannel) { return(GetOrAddExisting(ContentChannelCache.CacheKey(contentChannel.Id), () => LoadByModel(contentChannel))); }
/// <summary> /// Removes content channel from cache /// </summary> /// <param name="id"></param> public static void Flush(int id) { FlushCache(ContentChannelCache.CacheKey(id)); FlushCache("Rock:ContentChannel:All"); }
/// <summary> /// Returns content channel object from cache. If content channel 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 ContentChannelCache Read(int id, RockContext rockContext = null) { return(GetOrAddExisting(ContentChannelCache.CacheKey(id), () => LoadById(id, rockContext))); }