コード例 #1
0
 public T?TryGet(OneOf <T, OneOf.Types.None>?snapshotValue)
 {
     snapshotValue ??= updatedValue;
     return(snapshotValue.Value.Match(
                v => v,
                _ => db.TryGet <T>(key, columnFamily)));
 }
コード例 #2
0
#pragma warning disable CS8764 // Nullability of reference types in return type doesn't match overridden member.
            // Neo 2.x is not compiled with C# 8, so not sure why C# compiler thinks
            // TryGetInternal can't return null. But it can so suppress the warning.
            protected override TValue?TryGetInternal(TKey key)
#pragma warning restore CS8764 // Nullability of reference types in return type doesn't match overridden member.
            {
                return(db.TryGet <TKey, TValue>(key, familyHandle, readOptions));
            }