public virtual byte[] GetValue(ByteArray entityId) { var key = IndexGenerator.GetEntityKey(entityId); var value = Database.Get(key); return(value); }
public bool Contains(ByteArray entityId) { var key = IndexGenerator.GetEntityKey(entityId); var value = Database.Get(key); return(value != null); }
public virtual KeyValuePair <byte[], byte[]>[] GetValues(ByteArray[] entityIds) { var keys = entityIds.Select(id => IndexGenerator.GetEntityKey(id)).ToArray(); var values = Database.MultiGet(keys); return(values); //var result = new KeyValuePair<byte[], byte[]>[values.Length]; //for (int i = 0; i < result.Length; i++) //{ // ByteArray id = null; // if (entityIds[i].Bytes.ContainsSequence32(values[i].Key)) // id = entityIds[i]; // else // id = new ByteArray(values[i].Key); // result[i] = new KeyValuePair<ByteArray, byte[]>(id, values[i].Value); //} //return result; }
//public virtual KeyValuePair<ByteArray, byte[]>[] Get(ByteArray[] entityIds) //{ // var keys = entityIds.Select(id => IndexGenerator.GetEntityKey(id)).ToArray(); // var values = Database.MultiGet(keys); // var result = new KeyValuePair<ByteArray, byte[]>[values.Length]; // for (int i = 0; i < result.Length; i++) // { // ByteArray id = null; // if (entityIds[i].Bytes.ContainsSequence32(values[i].Key)) // id = entityIds[i]; // else // id = new ByteArray(values[i].Key); // result[i] = new KeyValuePair<ByteArray, byte[]>(id, values[i].Value); // } // return result; //} public virtual IEnumerable <KeyValuePair <byte[], byte[]> > GetValues(OrderType orderType, bool distinct = false) { var skey = IndexGenerator.GetEntityOrderKey(orderType); return(Database.Search(skey, distinct, true)); }
public IEnumerable <KeyValuePair <byte[], byte[]> > GetValues(bool distinct = false) { var skey = IndexGenerator.GetEntityName(); return(Database.Search(skey, distinct, false)); }
public IEnumerable <KeyValuePair <byte[], byte[]> > GetValues(ByteArray parentId, bool distinct = false) { var key = IndexGenerator.GetParentEntityName(parentId); return(Database.Search(key, distinct, false)); }
public virtual IEnumerable <KeyValuePair <byte[], byte[]> > GetValues(ByteArray parentId, OrderType orderType, bool distinct = false) { var skey = IndexGenerator.GetParentOrderKey(parentId, orderType); return(Database.Search(skey, distinct, true)); }