public async Task ClearAllCaches() { await Task.FromResult(1); CachingStrategyContext _CachingStrategyContext = IResolver.Current.CachingStrategyContext; CachingRepositoryStrategy _CachingRepositoryStrategy = IResolver.Current.CachingRepositoryStrategy; CachingModuleStrategy _CachingModuleStrategy = IResolver.Current.CachingModuleStrategy; _CachingStrategyContext.SetStrategy(_CachingRepositoryStrategy); await ClearCache(_CachingStrategyContext); _CachingStrategyContext.SetStrategy(_CachingModuleStrategy); await ClearCache(_CachingStrategyContext); }
public async Task <bool> AddToRepositoryCache(string functionName, string key, object obj, short minutesBeforeExpiration) { await Task.FromResult(1); CachingStrategyContext _CachingStrategyContext = IResolver.Current.CachingStrategyContext; CachingRepositoryStrategy _CachingRepositoryStrategy = IResolver.Current.CachingRepositoryStrategy; _CachingStrategyContext.SetStrategy(_CachingRepositoryStrategy); return(await AddToCache(_CachingStrategyContext, functionName, key, obj, minutesBeforeExpiration)); }
public async Task <bool> AddToModuleCache(string functionName, string key, string retStr) { await Task.FromResult(1); CachingStrategyContext _CachingStrategyContext = IResolver.Current.CachingStrategyContext; CachingModuleStrategy _CachingModuleStrategy = IResolver.Current.CachingModuleStrategy; _CachingStrategyContext.SetStrategy(_CachingModuleStrategy); return(await AddToCache(_CachingStrategyContext, functionName, key, retStr)); }
public object GetDataFromRepositoryCache(string functionName, string key) { CachingStrategyContext _CachingStrategyContext = IResolver.Current.CachingStrategyContext; CachingRepositoryStrategy _CachingRepositoryStrategy = IResolver.Current.CachingRepositoryStrategy; _CachingStrategyContext.SetStrategy(_CachingRepositoryStrategy); string strCacheKey = string.Concat(functionName, "-", key); var objCache = _CachingStrategyContext.CacheGetFromKey(strCacheKey); return(objCache); }
public string GetMessageFromModuleCache(string functionName, string key) { _cachingStrategyContext.SetStrategy(_cachingModuleStrategy); string retStr = ""; string loadingStr = ""; string strCacheKey = string.Concat(functionName, "-", key); var objCache = _cachingStrategyContext.CacheGetFromKey(strCacheKey); if (objCache != null) { loadingStr = "\n**(cached data^)**"; retStr = (string)objCache; return(string.Concat(loadingStr, retStr)); } return(string.Empty); }