protected override IEnumerable <KeyValuePair <TKey, TValue> > FindInternal(byte[] key_prefix)
 {
     return(db.Find(ReadOptions.Default, SliceBuilder.Begin(prefix).Add(key_prefix), (k, v) => new KeyValuePair <TKey, TValue>(k.ToArray().AsSerializable <TKey>(1), v.ToArray().AsSerializable <TValue>())));
 }
示例#2
0
文件: Helper.cs 项目: yongjiema/neo
 public static void Delete(this WriteBatch batch, byte prefix, ISerializable key)
 {
     batch.Delete(SliceBuilder.Begin(prefix).Add(key));
 }
示例#3
0
文件: Helper.cs 项目: yongjiema/neo
 public static void Put(this WriteBatch batch, byte prefix, ISerializable key, ISerializable value)
 {
     batch.Put(SliceBuilder.Begin(prefix).Add(key), value.ToArray());
 }
示例#4
0
文件: Helper.cs 项目: yongjiema/neo
 public static T Get <T>(this DB db, ReadOptions options, byte prefix, ISerializable key, Func <Slice, T> resultSelector)
 {
     return(resultSelector(db.Get(options, SliceBuilder.Begin(prefix).Add(key))));
 }
示例#5
0
文件: Helper.cs 项目: yongjiema/neo
 public static T Get <T>(this DB db, ReadOptions options, byte prefix, ISerializable key) where T : class, ISerializable, new()
 {
     return(db.Get(options, SliceBuilder.Begin(prefix).Add(key)).ToArray().AsSerializable <T>());
 }
示例#6
0
文件: Helper.cs 项目: yongjiema/neo
 public static IEnumerable <T> Find <T>(this DB db, ReadOptions options, byte prefix) where T : class, ISerializable, new()
 {
     return(Find(db, options, SliceBuilder.Begin(prefix), (k, v) => v.ToArray().AsSerializable <T>()));
 }