public V GetOrCreate <V>(string cacheKey, Func <V> create, int cacheDurationInSeconds = int.MaxValue) { var cacheManager = HttpRuntimeCacheHelper <V> .GetInstance(); if (cacheManager.ContainsKey(cacheKey)) { return(cacheManager[cacheKey]); } else { var result = create(); cacheManager.Add(cacheKey, result, cacheDurationInSeconds); return(result); } }
public void Remove <V>(string key) { HttpRuntimeCacheHelper <V> .GetInstance().Remove(key); }
public IEnumerable <string> GetAllKey <V>() { return(HttpRuntimeCacheHelper <V> .GetInstance().GetAllKey()); }
public V Get <V>(string key) { return(HttpRuntimeCacheHelper <V> .GetInstance().Get(key)); }
public bool ContainsKey <V>(string key) { return(HttpRuntimeCacheHelper <V> .GetInstance().ContainsKey(key)); }
public void Add <V>(string key, V value, int cacheDurationInSeconds) { HttpRuntimeCacheHelper <V> .GetInstance().Add(key, value, cacheDurationInSeconds); }
public void Add <V>(string key, V value) { HttpRuntimeCacheHelper <V> .GetInstance().Add(key, value); }