ContainsKey() public method

Check whether data exists in database.
public ContainsKey ( LightningDatabase db, byte key ) : bool
db LightningDatabase Database.
key byte Key.
return bool
        public static bool ContainsKey <TKey>(this LightningTransaction txn, LightningDatabase db, TKey key)
        {
            var keyBytes = db.ToBytes(key);

            return(txn.ContainsKey(db, keyBytes));
        }
示例#2
0
 /// <summary>
 /// Check whether data exists in database.
 /// </summary>
 /// <param name="txn">A transaction</param>
 /// <param name="key">Key.</param>
 /// <returns>True if key exists, false if not.</returns>
 public static bool ContainsKey(this LightningTransaction txn, byte[] key)
 {
     return(txn.ContainsKey(txn.OpenDatabase(), key));
 }