public static GetByOperation GetBy <TKey>(this LightningTransaction txn, LightningDatabase db, TKey key) { var valueBytes = txn.GetRawValue(db, key); return(new GetByOperation(db, valueBytes)); }
/// <summary> /// Gets a value by its key as a byte array. /// </summary> /// <typeparam name="TKey">Key type.</typeparam> /// <param name="txn">Transaction.</param> /// <param name="key">Key.</param> /// <returns>Value as a byte array or null if not exists.</returns> public static byte[] GetRawValue <TKey>(this LightningTransaction txn, TKey key) { return(txn.GetRawValue(txn.OpenDatabase(), key)); }