Exemple #1
0
 public void Add(string key, object value, TimeSpan timeSpan)
 {
     DefaultMemoryCache.Set(GetKeySuffix(key), value, timeSpan.TotalSeconds);
 }
Exemple #2
0
 public async void AddAsync(string key, object value, TimeSpan timeSpan)
 {
     await Task.Run(() => DefaultMemoryCache.Set(GetKeySuffix(key), value, timeSpan.TotalSeconds));
 }
Exemple #3
0
 public async void AddAsync(string key, object value, long numOfMinutes)
 {
     await Task.Run(() => DefaultMemoryCache.Set(GetKeySuffix(key), value, numOfMinutes));
 }
Exemple #4
0
 public void Add(string key, object value, long numOfMinutes)
 {
     DefaultMemoryCache.Set(GetKeySuffix(key), value, numOfMinutes);
 }
Exemple #5
0
 public async void AddAsync(string key, object value, bool defaultExpire)
 {
     await Task.Run(() => DefaultMemoryCache.Set(GetKeySuffix(key), value, defaultExpire ? DefaultExpireTime : ExpireTime));
 }
Exemple #6
0
 public void Add(string key, object value, bool defaultExpire)
 {
     DefaultMemoryCache.Set(GetKeySuffix(key), value, defaultExpire ? DefaultExpireTime : ExpireTime);
 }
Exemple #7
0
 public void Add(string key, object value)
 {
     DefaultMemoryCache.Set(GetKeySuffix(key), value, _defaultExpireTime.Value);
 }