コード例 #1
0
 /// <summary>
 /// Reads the specified defined type model.
 /// </summary>
 /// <param name="restControllerModel">The rest controller model.</param>
 /// <returns></returns>
 public static RestControllerCache Read(RestController restControllerModel)
 {
     return(GetOrAddExisting(RestControllerCache.CacheKey(restControllerModel.Id),
                             () => LoadByModel(restControllerModel)));
 }
コード例 #2
0
 /// <summary>
 /// Removes RestController from cache
 /// </summary>
 /// <param name="id"></param>
 public static void Flush(int id)
 {
     FlushCache(RestControllerCache.CacheKey(id));
 }
コード例 #3
0
 /// <summary>
 /// Returns RestController object from cache.  If RestController 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 RestControllerCache Read(int id, RockContext rockContext = null)
 {
     return(GetOrAddExisting(RestControllerCache.CacheKey(id),
                             () => LoadById(id, rockContext)));
 }