示例#1
0
 public Task <int> RemoveByPrefixAsync(string prefix)
 {
     return(UnscopedCache.RemoveByPrefixAsync(GetScopedCacheKey(prefix)));
 }
示例#2
0
 public Task <CacheValue <T> > GetAsync <T>(string key)
 {
     return(UnscopedCache.GetAsync <T>(GetScopedCacheKey(key)));
 }
示例#3
0
 public Task <long> SetIfLowerAsync(string key, long value, TimeSpan?expiresIn = null)
 {
     return(UnscopedCache.SetIfLowerAsync(GetScopedCacheKey(key), value, expiresIn));
 }
示例#4
0
 public Task <long> SetRemoveAsync <T>(string key, IEnumerable <T> values, TimeSpan?expiresIn = null)
 {
     return(UnscopedCache.SetRemoveAsync(GetScopedCacheKey(key), values, expiresIn));
 }
示例#5
0
 public Task SetExpirationAsync(string key, TimeSpan expiresIn)
 {
     return(UnscopedCache.SetExpirationAsync(GetScopedCacheKey(key), expiresIn));
 }
示例#6
0
 public Task <double> SetIfHigherAsync(string key, double value, TimeSpan?expiresIn = null)
 {
     return(UnscopedCache.SetIfHigherAsync(GetScopedCacheKey(key), value, expiresIn));
 }
示例#7
0
 public Task <bool> ExistsAsync(string key)
 {
     return(UnscopedCache.ExistsAsync(GetScopedCacheKey(key)));
 }
示例#8
0
 public Task <TimeSpan?> GetExpirationAsync(string key)
 {
     return(UnscopedCache.GetExpirationAsync(GetScopedCacheKey(key)));
 }
示例#9
0
 public Task <bool> ReplaceAsync <T>(string key, T value, TimeSpan?expiresIn = null)
 {
     return(UnscopedCache.ReplaceAsync(GetScopedCacheKey(key), value, expiresIn));
 }
示例#10
0
 public Task <long> IncrementAsync(string key, long amount, TimeSpan?expiresIn = null)
 {
     return(UnscopedCache.IncrementAsync(GetScopedCacheKey(key), amount, expiresIn));
 }
示例#11
0
 public Task <int> SetAllAsync <T>(IDictionary <string, T> values, TimeSpan?expiresIn = null)
 {
     return(UnscopedCache.SetAllAsync(values?.ToDictionary(kvp => GetScopedCacheKey(kvp.Key), kvp => kvp.Value), expiresIn));
 }
示例#12
0
        public async Task <IDictionary <string, CacheValue <T> > > GetAllAsync <T>(IEnumerable <string> keys)
        {
            var scopedDictionary = await UnscopedCache.GetAllAsync <T>(GetScopedCacheKeys(keys)).AnyContext();

            return(scopedDictionary.ToDictionary(kvp => UnscopeCacheKey(kvp.Key), kvp => kvp.Value));
        }
示例#13
0
 public Task <bool> RemoveIfEqualAsync <T>(string key, T expected)
 {
     return(UnscopedCache.RemoveIfEqualAsync(GetScopedCacheKey(key), expected));
 }
示例#14
0
 public Task <bool> RemoveAsync(string key)
 {
     return(UnscopedCache.RemoveAsync(GetScopedCacheKey(key)));
 }
示例#15
0
 public Task <CacheValue <ICollection <T> > > GetListAsync <T>(string key, int?page = null, int pageSize = 100)
 {
     return(UnscopedCache.GetListAsync <T>(GetScopedCacheKey(key), page, pageSize));
 }