public static byte[] ValueForKey(this HashDatabase store, InternalId key) { try { return store.Get(new DatabaseEntry(key.AsByteArray())).Value.Data; } catch(NotFoundException) { Assert.Fail("ValueForKey: Key not found"); } return null; }
public static void ShouldNotHaveKey(this HashDatabase store, InternalId key) { store.Exists(new DatabaseEntry(key.AsByteArray())).ShouldBeFalse(); }
public void Insert(object untypedKey, InternalId internalId, Transaction transaction) { index .Put( new DatabaseEntry(KeyAsByteArray(untypedKey)), new DatabaseEntry(internalId.AsByteArray()), transaction); reverseIndex .Put( new DatabaseEntry(internalId.AsByteArray()), new DatabaseEntry(KeyAsByteArray(untypedKey)), transaction); }