protected override T TryGetInternal() { if (!db.TryGet(ReadOptions.Default, prefix, out Slice slice)) { return(null); } return(slice.ToArray().AsSerializable <T>()); }
public static T TryGet <T>(this DB db, ReadOptions options, byte prefix, ISerializable key) where T : class, ISerializable, new() { Slice slice; if (!db.TryGet(options, SliceBuilder.Begin(prefix).Add(key), out slice)) { return(null); } return(slice.ToArray().AsSerializable <T>()); }
public static T TryGet <T>(this DB db, ReadOptions options, byte prefix, ISerializable key, Func <Slice, T> resultSelector) where T : class { Slice slice; if (!db.TryGet(options, SliceBuilder.Begin(prefix).Add(key), out slice)) { return(null); } return(resultSelector(slice)); }
protected override TValue TryGetInternal(TKey key) { return(db.TryGet <TValue>(ReadOptions.Default, prefix, key)); }