/// <summary>
 /// 将RedisValue反序列化成对象
 /// </summary>
 /// <typeparam name="T">数据类型</typeparam>
 /// <param name="value">值</param>
 /// <returns></returns>
 private T ToObj <T>(RedisValue value)
 {
     if (typeof(T).IsValueType || typeof(T) == typeof(string))
     {
         return(Conv.To <T>(value));
     }
     return(value.SafeString().ToObject <T>());
 }
 /// <summary>
 /// 将RedisValue反序列化成对象
 /// </summary>
 /// <param name="value">值</param>
 /// <param name="type">数据类型</param>
 /// <returns></returns>
 private object ToObj(RedisValue value, Type type)
 {
     return(JsonUtil.ToObject(value.SafeString(), type));
 }
Exemple #3
0
 /// <summary>
 /// 将RedisValue反序列化成对象
 /// </summary>
 /// <typeparam name="T">数据类型</typeparam>
 /// <param name="value">值</param>
 /// <returns></returns>
 private T ToObj <T>(RedisValue value)
 {
     return(value.SafeString().ToObject <T>());
 }