예제 #1
0
        public void DatabaseDeleteShouldRemoveItem()
        {
            var key   = "key";
            var value = "value";

            _txn.Put(_db, key, value);

            _txn.Delete(_db, key);

            Assert.False(_txn.ContainsKey(_db, key));
        }
예제 #2
0
        public void DatabaseDeleteShouldRemoveItem()
        {
            //arrange
            var key   = "key";
            var value = "value";

            _txn.Put(_db, key, value);

            //act
            _txn.Delete(_db, key);

            //assert
            Assert.IsFalse(_txn.ContainsKey(_db, key));
        }
예제 #3
0
 private void DeleteImpl(IEnumerable <TKey> keys)
 {
     foreach (var key in keys.Select(_settings.SerializeKey))
     {
         if (_tx.ContainsKey(_db, key))
         {
             _tx.Delete(_db, key);
         }
     }
 }
예제 #4
0
        public static bool ContainsKey(this LightningTransaction tx, LightningDatabase db, string key)
        {
            var enc = System.Text.Encoding.UTF8;

            return(tx.ContainsKey(db, enc.GetBytes(key)));
        }