private int GetPartitionGeneration(TPartition partition) { if (!GenerationalCachingEnabled) { return(1); // no need to use the caching provider } return(!CachingProvider.Get(GetPartitionGenerationKey(partition), out int generation) ? 1 : generation); }
private int GetGeneration() { if (!GenerationalCachingEnabled) { return(1); // no need to use the caching provider } int generation; return(!CachingProvider.Get(GetGenerationKey(), out generation) ? 1 : generation); }
protected bool IsPagingTotalInCache(string cacheKey, out int totalItems) { totalItems = 0; try { if (CachingProvider.Get(cacheKey + "=>pagingTotal", out totalItems)) { //Trace.WriteLine(String.Format("Got item from cache: {0} - {1}", cacheKey, typeof(TCacheItem).Name)); return(true); } } catch (Exception) { // don't let caching errors cause problems for the Repository } return(false); }
protected bool IsInCache <TCacheItem>(string cacheKey, out TCacheItem result) { result = default(TCacheItem); try { if (CachingProvider.Get(cacheKey, out result)) { return(true); } } catch (Exception) { // don't let caching errors cause problems for the Repository } return(false); }
private int GetCachingPrefixCounter() { return(!CachingProvider.Get(GetCachingPrefixCounterKey(), out int counter) ? 1 : counter); }