private CachedResourceStatistics AddCategoryStats() { CachedResourceStatistics s = new CachedResourceStatistics() { Count = 0, LastUpdated = DateTime.UtcNow, ResourceKey = KEY_CATEGORIES, BucketId = BucketId }; s = this.CachedResourceStatisticsRepository.Insert(this.UserId, this.BucketId, s, true); return(s); }
public DateTime GetCategoriesLastUpdate() { if (!AllowExecute()) { throw new Exception("Forbidden"); } CachedResourceStatistics s = this.CachedResourceStatisticsRepository.FimdById(KEY_CATEGORIES, BucketId); if (s == null) { s = AddCategoryStats(); } return(s.LastUpdated); }
public void UpdateCategoryStats() { if (!AllowExecute()) { throw new Exception("Forbidden"); } CachedResourceStatistics s = this.CachedResourceStatisticsRepository.FimdById(KEY_CATEGORIES, BucketId); if (s == null) { s = AddCategoryStats(); } else { s.LastUpdated = DateTime.UtcNow; this.CachedResourceStatisticsRepository.Update(this.UserId, this.BucketId, s); } }