Example #1
0
        public async Task <bool> SetCacheItemAsync(string url, ResponseContext content, IEnumerable <KeyValuePair <string, string> > postData = null)
        {
            var key = KeyHelper.GetKey(nameof(ResponseContext), url, postData);

            return(await cache.SetAsync <ResponseContext>(key, content, duration));
        }
Example #2
0
        public async Task <bool> SetCacheItemAsync(string url, ResponseContext content)
        {
            var key = KeyHelper.GetKey(nameof(ResponseContext), url);

            return(await cache.SetAsync <ResponseContext>(key, content, duration));
        }
Example #3
0
        public async Task <ResponseContext> UseCachedAsync(string url, IEnumerable <KeyValuePair <string, string> > postData, Func <Task <ResponseContext> > funcAsync, EnumCacheStrategy strategy = EnumCacheStrategy.CacheIfNotExist)
        {
            ResponseContext res = await this.GetCacheResponseContextAsync(url, postData);

            return(await CachedAsync(url, funcAsync, strategy, res));
        }