Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
 public override byte[] Get(StorageKey key)
 {
     return(Adapter.GetValue(key.keyData));
 }