コード例 #1
0
ファイル: LavaShortcodeCache.cs プロジェクト: sjison/Rock
        /// <summary>
        /// Removes Lava shortcode from cache
        /// </summary>
        /// <param name="id"></param>
        public static void Flush(int id)
        {
            FlushCache(LavaShortcodeCache.CacheKey(id));
            FlushCache("Rock:LavaShortcode:All");

            // some of the cached lavatemplates might have a reference to this shortcode, so flush them all just in case
            LavaTemplateCache.Flush();
        }
コード例 #2
0
ファイル: LavaShortcodeCache.cs プロジェクト: sjison/Rock
 /// <summary>
 /// Adds lava shortcode model to cache, and returns cached object
 /// </summary>
 /// <param name="shortcodeModel"></param>
 /// <returns></returns>
 public static LavaShortcodeCache Read(LavaShortcode shortcodeModel)
 {
     return(GetOrAddExisting(LavaShortcodeCache.CacheKey(shortcodeModel.Id),
                             () => LoadByModel(shortcodeModel)));
 }
コード例 #3
0
ファイル: LavaShortcodeCache.cs プロジェクト: sjison/Rock
 /// <summary>
 /// Returns lava shortcode object from cache.  If lava shortcode 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 LavaShortcodeCache Read(int id, RockContext rockContext = null)
 {
     return(GetOrAddExisting(LavaShortcodeCache.CacheKey(id),
                             () => LoadById(id, rockContext)));
 }