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