/// <summary> /// 转CtSharpRedisValue数组 /// </summary> /// <param name="stringValues"></param> /// <returns></returns> public static CtSharpRedisValue[] ConvertToRedisValueArrary(string[] stringValues) { if (stringValues.IsNullOrEmptyArrary()) { return(Array.Empty <CtSharpRedisValue>()); } CtSharpRedisValue[] result = new CtSharpRedisValue[stringValues.Length]; for (int i = 0; i < stringValues.Length; i++) { result[i] = new CtSharpRedisValue() { Value = stringValues[i] }; } return(result); }
/// <summary> /// 反序列化 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="redisValue"></param> /// <returns></returns> public static T DeserializeRedisValue <T>(CtSharpRedisValue redisValue) { return((T)SerializeSettings.DeserializeRedisValue <T>(redisValue.Value)); }