private static ManagementCache GetCache() { try { ManagementCache dataObject = (ManagementCache)HttpContext.Current.Cache["ManagementCache"]; if (dataObject == null) { lock (ThisLock) { if (dataObject == null) { dataObject = new ManagementCache(); dataObject.BoutChallengesCount = RDN.Library.Classes.League.BoutList.GetBoutListCount(); dataObject.OfficiatingRequestsCount = RDN.Library.Classes.Officials.RequestFactory.GetRequestCount(); HttpContext.Current.Cache["ManagementCache"] = dataObject; } } } return dataObject; } catch (Exception exception) { ErrorDatabaseManager.AddException(exception, exception.GetType()); } return null; }
private static ManagementCache UpdateCache(ManagementCache siteCache) { try { lock (ThisLock) { HttpContext.Current.Cache["ManagementCache"] = siteCache; } return siteCache; } catch (Exception exception) { ErrorDatabaseManager.AddException(exception, exception.GetType()); } return null; }