public void Remove(VBCacheKey key, string subKeyPrefix) { string fullKey = CombineKey(key, subKeyPrefix); var matchingKeys = keys.Where(k => k.StartsWith(fullKey)) .ToList(); logger.LogDebug($"Remove FullKey = {fullKey} with matching keys = {string.Join(",", matchingKeys)}"); matchingKeys.ForEach(matchingKey => memoryCache.Remove(matchingKey)); }
public void Set(VBCacheKey key, object value, TimeSpan?expire = null) { }
public void Remove(VBCacheKey key, string subKeyPrefix) { }
public bool TryGet <T>(VBCacheKey key, string subKey, out T value) { value = default(T); return(false); }
string CombineKey(VBCacheKey key, string subKey) { return($"{key.ToString()}.{subKey}"); }
public bool TryGet <T>(VBCacheKey key, string subKey, out T value) { return(TryGet(CombineKey(key, subKey), out value)); }
public bool TryGet <T>(VBCacheKey key, out T value) { return(TryGet(key.ToString(), out value)); }
public void Set(VBCacheKey key, string subKey, object value, TimeSpan?expire = null) { Set(CombineKey(key, subKey), value, expire); }
public void Set(VBCacheKey key, object value, TimeSpan?expire = null) { Set(key.ToString(), value, expire); }