/// <inheritdoc /> public TV Get <TK, TV>(TK key) where TV : class { if (_memoryCache.TryGetValue(key, out TV output)) { return(output); } output = _distributedCache.GetJson <TV>(key.ToString()); if (output != null) { _usedKeys.Add(key); _memoryCache.Set(key, output, _slidingExpiry); } return(output); }
public V Get <K, V>(K key) where V : class { V output = null; if (memoryCache.TryGetValue(key, out output)) { return(output); } else { output = distributedCache.GetJson <V>(key.ToString()); if (output != null) { usedKeys.Add(key); memoryCache.Set(key, output, slidingExpiry); } return(output); } }
public V Get <K, V>(K key) where V : class { return(distributed.GetJson <V>(key.ToString())); }
/// <inheritdoc /> public TV Get <TK, TV>(TK key) where TV : class { return(_distributed.GetJson <TV>(key.ToString())); }