Exemplo n.º 1
0
 /// <summary>
 /// 获取radis值
 /// </summary>
 /// <typeparam name="T">类型</typeparam>
 /// <param name="key">键</param>
 /// <returns></returns>
 public T Get <T>(string key)
 {
     return(RadisManager.GetClient().Get <T>(key));
 }
Exemplo n.º 2
0
 /// <summary>
 /// 数字递减存储键值
 /// </summary>
 /// <param name="key">键</param>
 /// <param name="amount">整数</param>
 /// <returns></returns>
 public long Decrement(string key, uint amount)
 {
     return(RadisManager.GetClient().Decrement(key, amount));
 }
Exemplo n.º 3
0
 /// <summary>
 ///  清空当前radis数据库中的所有键
 /// </summary>
 public void FlushDb()
 {
     RadisManager.GetClient().FlushDb();
 }
Exemplo n.º 4
0
 /// <summary>
 /// 添加Radis(过期时间)
 /// </summary>
 /// <typeparam name="T">类型</typeparam>
 /// <param name="key">键</param>
 /// <param name="value">值</param>
 /// <param name="expiresAt">过期时间</param>
 /// <returns></returns>
 public bool Add <T>(string key, T value, DateTime expiresAt)
 {
     return(RadisManager.GetClient().Add <T>(key, value, expiresAt));
 }
Exemplo n.º 5
0
 /// <summary>
 /// 添加Radis(时间间隔)
 /// </summary>
 /// <typeparam name="T">类型</typeparam>
 /// <param name="key">键</param>
 /// <param name="value">值</param>
 /// <param name="expiresIn">时间间隔</param>
 /// <returns></returns>
 public bool Add <T>(string key, T value, TimeSpan expiresIn)
 {
     return(RadisManager.GetClient().Add <T>(key, value, expiresIn));
 }
Exemplo n.º 6
0
 public void Dispose()
 {
     RadisManager.GetClient().Dispose();
 }
Exemplo n.º 7
0
 /// <summary>
 /// 添加Radis
 /// </summary>
 /// <typeparam name="T">类型</typeparam>
 /// <param name="key">键</param>
 /// <param name="value">值</param>
 /// <returns></returns>
 public bool Add <T>(string key, T value)
 {
     return(RadisManager.GetClient().Add <T>(key, value));
 }
Exemplo n.º 8
0
 /// <summary>
 /// 根据传入的多个key覆盖多条记录
 /// </summary>
 /// <typeparam name="T">类型</typeparam>
 /// <param name="values">值</param>
 public void SetAll <T>(IDictionary <string, T> values)
 {
     RadisManager.GetClient().SetAll <T>(values);
 }
Exemplo n.º 9
0
 /// <summary>
 /// 根据传入的key覆盖一条记录的值,当key不存在不会添加
 /// </summary>
 /// <typeparam name="T">类型</typeparam>
 /// <param name="key">键</param>
 /// <param name="value">值</param>
 /// <returns></returns>
 public bool Replace <T>(string key, T value)
 {
     return(RadisManager.GetClient().Replace <T>(key, value));
 }
Exemplo n.º 10
0
 /// <summary>
 /// 删除多个键值
 /// </summary>
 /// <param name="keys">键</param>
 public void RemoveAll(IEnumerable <string> keys)
 {
     RadisManager.GetClient().RemoveAll(keys);
 }
Exemplo n.º 11
0
 /// <summary>
 /// 更具键删除键值
 /// </summary>
 /// <param name="key">键</param>
 /// <returns></returns>
 public bool Remove(string key)
 {
     return(RadisManager.GetClient().Remove(key));
 }
Exemplo n.º 12
0
 /// <summary>
 /// 根据传入的多个key获取多条记录的值
 /// </summary>
 /// <typeparam name="T">类型</typeparam>
 /// <param name="keys">多个键</param>
 /// <returns></returns>
 public IDictionary <string, T> GetAll <T>(IEnumerable <string> keys)
 {
     return(RadisManager.GetClient().GetAll <T>(keys));
 }