public T Get <T>(RedisClient db = null) { db = RedisClient.GetClient(db); return((T)db.GetFields((string)mDataKey, new NameType[] { new NameType(typeof(T)) }, mDataType).FieldValueToList()[0]); }
public IList <object> GetFields <T, T1>(RedisClient db = null) { db = RedisClient.GetClient(db); return(db.GetFields((string)DataKey, new NameType[] { new NameType(typeof(T)), new NameType(typeof(T1)) }, DataType).FieldValueToList()); }
public IList <object> Get(string[] fields, Type[] types, RedisClient db = null) { NameType[] nts = new NameType[fields.Length]; for (int i = 0; i < fields.Length; i++) { nts[0] = new NameType(types[i], fields[i], i); } db = RedisClient.GetClient(db); return(db.GetFields(mDataKey, nts, mDataType).FieldValueToList()); }
public void Delete(RedisClient db = null) { db = RedisClient.GetClient(db); if (mIsSingleKey) { db.Delete((string)DataKey); } else { db.Delete(GetKeys); } }
public void SetValues(object[] values, RedisClient db = null) { db = RedisClient.GetClient(db); List <Field> kvs = new List <Field>(); string[] keys = GetKeys; int count = keys.Length > values.Length ? values.Length : keys.Length; for (int i = 0; i < count; i++) { kvs.Add(new Field { Value = values[i], Name = keys[i] }); } db.Set(kvs.ToArray(), DataType); }
public IList <T> LstRange <T>(RedisClient db = null) { db = RedisClient.GetClient(db); return(db.ListRange <T>((string)DataKey, DataType)); }
public int Expire(long seconds, RedisClient db = null) { db = RedisClient.GetClient(db); return(db.EXPIRE((string)DataKey, seconds)); }
public int PExpire(long milliseconds, RedisClient db = null) { db = RedisClient.GetClient(db); return(db.PEXPIRE((string)DataKey, milliseconds)); }
public IList <object> Get <T, T1, T2, T3, T4>(RedisClient db = null) { db = RedisClient.GetClient(db); return(db.Get(new Type[] { typeof(T), typeof(T1), typeof(T2), typeof(T3), typeof(T4) }, GetKeys, DataType)); }
public long PTTL(RedisClient db = null) { db = RedisClient.GetClient(db); return(db.PTTL((string)DataKey)); }
public void SetField(Field[] fields, RedisClient db = null) { db = RedisClient.GetClient(db); db.SetFields((string)DataKey, fields, DataType); }
public IList <object> Get(Type[] types, RedisClient db = null) { db = RedisClient.GetClient(db); return(db.Get(types, GetKeys, DataType)); }
public void Push(T value, RedisClient db = null) { db = RedisClient.GetClient(db); db.ListPush((string)mDataKey, value, mDataType); }
public void Clear(RedisClient db = null) { db = RedisClient.GetClient(db); db.Delete(mDataKey); }
public IList <string> Keys(RedisClient db = null) { db = RedisClient.GetClient(db); return(db.Keys((string)DataKey)); }
public void Set(object value, RedisClient db = null) { db = RedisClient.GetClient(db); db.Set((string)DataKey, value, DataType); }
public IList <T> LstRange <T>(int start, int end, RedisClient db = null) { db = RedisClient.GetClient(db); return(db.ListRange <T>((string)DataKey, start, end, DataType)); }
public void LstPush(object value, RedisClient db = null) { db = RedisClient.GetClient(db); db.ListPush((string)DataKey, value, DataType); }
public T LstRemove <T>(RedisClient db = null) { db = RedisClient.GetClient(db); return(db.ListRemove <T>((string)DataKey, DataType)); }
public int LstCount(RedisClient db = null) { db = RedisClient.GetClient(db); return(db.ListLength((string)DataKey)); }
public void Remove(string[] fields, RedisClient db = null) { db = RedisClient.GetClient(db); db.HDEL(mDataKey, fields); }
public T Get <T>(RedisClient db = null) { db = RedisClient.GetClient(db); return(db.Get <T>((string)DataKey, DataType)); }
public T LstGetItem <T>(int index, RedisClient db = null) { db = RedisClient.GetClient(db); return(db.GetListItem <T>((string)DataKey, index, DataType)); }
public void LstSetItem(int index, object value, RedisClient db = null) { db = RedisClient.GetClient(db); db.SetListItem((string)DataKey, index, value, DataType); }
public T Pop(RedisClient db = null) { db = RedisClient.GetClient(db); return(db.ListPop <T>((string)mDataKey, mDataType)); }