public bool TryGet(K key, out V value) { var keyBytes = Serialization.Serialize(key); var bytes = Adapter.GetValue(keyBytes); if (bytes == null) { value = default(V); return(false); } value = Serialization.Unserialize <V>(bytes); return(true); }
public V Get(K key) { var keyBytes = Serialization.Serialize(key); var bytes = Adapter.GetValue(keyBytes); if (bytes == null) { Throw.If(bytes == null, "item not found in keystore"); } return(Serialization.Unserialize <V>(bytes)); }
public override byte[] Get(StorageKey key) { return(Adapter.GetValue(key.keyData)); }