From ddf19417be571f3e4a5b301cdeb2a6402a734bbf Mon Sep 17 00:00:00 2001 From: dajiaohuang Date: Fri, 16 Oct 2026 05:29:19 +0800 Subject: [PATCH] Correct documented default for missing unique keys --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9dc1f694..b82c0ea2 100644 --- a/README.md +++ b/README.md @@ -251,7 +251,7 @@ public class Sample db.Sample.FindByBarAndFoo((int Bar, int Foo)) ``` -Default of `FindBy***` return type is single(if not found, returns `null`). It means key is unique by default. If mark `[NonUnique]` in same AttributeList, return type is `RangeView`(if not found, return empty). +By default, `FindBy***` returns a single element and throws `KeyNotFoundException` if the key is not found. Keys are unique by default. To return `null` for a missing unique key instead, set `IsReturnNullIfKeyNotFound = true` in `[MasterMemoryGeneratorOptions]`. If marked with `[NonUnique]` in the same AttributeList, the return type is `RangeView` (empty if not found). ```csharp [MemoryTable("sample"), MessagePackObject(true)]