示例#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);
        }
示例#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));
        }
示例#3
0
 public override byte[] Get(StorageKey key)
 {
     return(Adapter.GetValue(key.keyData));
 }