예제 #1
0
 /// <summary>
 /// Adds NoteType model to cache, and returns cached object
 /// </summary>
 /// <param name="NoteTypeModel">The NoteTypeModel to cache</param>
 /// <returns></returns>
 public static NoteTypeCache Read(Rock.Model.NoteType NoteTypeModel)
 {
     return(GetOrAddExisting(NoteTypeCache.CacheKey(NoteTypeModel.Id),
                             () => LoadByModel(NoteTypeModel)));
 }
예제 #2
0
 /// <summary>
 /// Removes NoteType from cache
 /// </summary>
 /// <param name="id">The id of the NoteType to remove from cache</param>
 public static void Flush(int id)
 {
     FlushCache(NoteTypeCache.CacheKey(id));
 }
예제 #3
0
 /// <summary>
 /// Returns NoteType object from cache.  If NoteType does not already exist in cache, it
 /// will be read and added to cache
 /// </summary>
 /// <param name="id">The id of the NoteType to read</param>
 /// <param name="rockContext">The rock context.</param>
 /// <returns></returns>
 public static NoteTypeCache Read(int id, RockContext rockContext = null)
 {
     return(GetOrAddExisting(NoteTypeCache.CacheKey(id),
                             () => LoadById(id, rockContext)));
 }