Beispiel #1
0
        public async Task <IDictionary <string, T> > GetAsync <T>(IEnumerable <string> keys)
        {
            keys.ToList().ForEach(key => GetKeySuffix(key));
            var result = await Task.Run(() => DefaultMemoryCache.Get <T>(keys));

            return(result);
        }
Beispiel #2
0
 public IDictionary <string, T> Get <T>(IEnumerable <string> keys)
 {
     keys.ToList().ForEach(key => GetKeySuffix(key));
     return(DefaultMemoryCache.Get <T>(keys));
 }
Beispiel #3
0
 public async void AddAsync(string key, object value, TimeSpan timeSpan)
 {
     await Task.Run(() => DefaultMemoryCache.Set(GetKeySuffix(key), value, timeSpan.TotalSeconds));
 }
Beispiel #4
0
 public void Add(string key, object value, TimeSpan timeSpan)
 {
     DefaultMemoryCache.Set(GetKeySuffix(key), value, timeSpan.TotalSeconds);
 }
Beispiel #5
0
 public async void AddAsync(string key, object value, long numOfMinutes)
 {
     await Task.Run(() => DefaultMemoryCache.Set(GetKeySuffix(key), value, numOfMinutes));
 }
Beispiel #6
0
 public void Add(string key, object value, long numOfMinutes)
 {
     DefaultMemoryCache.Set(GetKeySuffix(key), value, numOfMinutes);
 }
Beispiel #7
0
 public async void AddAsync(string key, object value, bool defaultExpire)
 {
     await Task.Run(() => DefaultMemoryCache.Set(GetKeySuffix(key), value, defaultExpire ? DefaultExpireTime : ExpireTime));
 }
Beispiel #8
0
 public void Add(string key, object value, bool defaultExpire)
 {
     DefaultMemoryCache.Set(GetKeySuffix(key), value, defaultExpire ? DefaultExpireTime : ExpireTime);
 }
Beispiel #9
0
 public void Add(string key, object value)
 {
     DefaultMemoryCache.Set(GetKeySuffix(key), value, _defaultExpireTime.Value);
 }
Beispiel #10
0
 public async void RemoveAsync(string key)
 {
     await Task.Run(() => DefaultMemoryCache.Remove(GetKeySuffix(key)));
 }
Beispiel #11
0
 public void Remove(string key)
 {
     DefaultMemoryCache.RemoveByPattern(GetKeySuffix(key));
 }
Beispiel #12
0
 public bool GetCacheTryParse(string key, out object obj)
 {
     return(DefaultMemoryCache.GetCacheTryParse(GetKeySuffix(key), out obj));
 }
Beispiel #13
0
        public async Task <T> GetAsync <T>(string key)
        {
            var result = await Task.Run(() => DefaultMemoryCache.Get <T>(GetKeySuffix(key)));

            return(result);
        }
Beispiel #14
0
 public T Get <T>(string key)
 {
     return(DefaultMemoryCache.Get <T>(GetKeySuffix(key)));
 }
Beispiel #15
0
 public object Get(string key)
 {
     return(DefaultMemoryCache.Get(GetKeySuffix(key)));
 }