public static bool TryGetBy <TKey>(this LightningTransaction txn, LightningDatabase db, TKey key, out GetByOperation value)
{
byte[] valueBytes;
var keyBytes = db.ToBytes(key);
var result = txn.TryGet(db, keyBytes, out valueBytes);
value = result
? new GetByOperation(db, valueBytes)
: null;
return(result);
}