/// <summary> /// Adds PersonBadge model to cache, and returns cached object /// </summary> /// <param name="personBadgeModel">The personBadge model.</param> /// <returns></returns> public static PersonBadgeCache Read(PersonBadge personBadgeModel) { return(GetOrAddExisting(PersonBadgeCache.CacheKey(personBadgeModel.Id), () => LoadByModel(personBadgeModel))); }
/// <summary> /// Removes personBadge from cache /// </summary> /// <param name="id"></param> public static void Flush(int id) { FlushCache(PersonBadgeCache.CacheKey(id)); }
/// <summary> /// Returns PersonBadge object from cache. If personBadge does not already exist in cache, it /// will be read and added to cache /// </summary> /// <param name="id">The id.</param> /// <param name="rockContext">The rock context.</param> /// <returns></returns> public static PersonBadgeCache Read(int id, RockContext rockContext = null) { return(GetOrAddExisting(PersonBadgeCache.CacheKey(id), () => LoadById(id, rockContext))); }