Beispiel #1
0
 /// <summary>
 /// 按条件移除缓存
 /// </summary>
 /// <param name="keyStartsWith">键起始名</param>
 public void ClearStartsWith(string keyStartsWith) => CacheContext.ClearStartsWith(keyStartsWith);
Beispiel #2
0
 /// <summary>
 /// 批量移除缓存
 /// </summary>
 /// <param name="keysStartsWith">键起始名集合</param>
 public void ClearStartsWith(List <string> keysStartsWith) => CacheContext.ClearStartsWith(keysStartsWith);
Beispiel #3
0
 /// <summary>
 /// 清理所有缓存
 /// </summary>
 public void Clear() => CacheContext.Clear();
Beispiel #4
0
 /// <summary>
 /// 移除缓存
 /// </summary>
 /// <param name="key">缓存键</param>
 public void Remove(string key) => CacheContext.Invalidate(key);
Beispiel #5
0
 /// <summary>
 /// 检查缓存是否存在
 /// </summary>
 /// <param name="key"></param>
 /// <returns></returns>
 public bool IsSet(string key) => CacheContext.IsSet(key);
Beispiel #6
0
 /// <summary>
 /// 根据缓存键获取缓存
 /// </summary>
 /// <param name="key">The key.</param>
 public T GetCache <T>(string key) => CacheContext.Get <T>(key);
Beispiel #7
0
 /// <summary>
 /// 创建缓存
 /// </summary>
 /// <param name="key">缓存键</param>
 /// <param name="val">缓存值</param>
 /// <param name="expire">缓存时间</param>
 /// <returns></returns>
 public void Set(string key, object val, CacheTimes expire) => CacheContext.Set(key, val, expire);