public async Task SetCachedValueAsync(CacheContext context, string value) { var cacheKey = await GetCacheKey(context); _localCache[cacheKey] = value; var esi = JsonConvert.SerializeObject(CacheContextModel.FromCacheContext(context)); await Task.WhenAll( SetCachedValueAsync(cacheKey, value, context), SetCachedValueAsync(GetCacheContextCacheKey(cacheKey), esi, context) ); }
public async Task SetCachedValueAsync(CacheContext context, string value) { if (!_cacheOptions.Enabled) { return; } var cacheKey = await GetCacheKey(context); _localCache[cacheKey] = value; var esi = _serializer.Serialize(CacheContextModel.FromCacheContext(context)); await Task.WhenAll( SetCachedValueAsync(cacheKey, value, context), SetCachedValueAsync(GetCacheContextCacheKey(cacheKey), esi, context) ); }