示例#1
0
        public static IReadOnlyList <byte> Get(this IIronLeveldb db, IReadOnlyList <byte> key)
        {
            var v = db.Seek(key).FirstOrDefault();

            var sk = v?.Key;

            if (sk?.Count == key.Count)
            {
                for (var i = key.Count - 1; i >= 0; i--)
                {
                    if (key[i] != sk[i])
                    {
                        return(null);
                    }
                }

                return(v.Value);
            }

            return(null);
        }
示例#2
0
 public static IEnumerable <IReadonlyBytesKeyValuePair> Seek(this IIronLeveldb db, string key)
 {
     return(db.Seek(StringToBytes(key)));
 }