Repository navigation
Docs: state the NULL policy and the async transaction token correctly; fix the struct constructor sentence - #137
Merged
Conversation
…ructor, constructor rules, excluding a member State the NULL policy once (mapping.md, "NULL in a non-nullable column") and point the other pages at it, including the single-value case (Map<int>().Single() over NULL is 0; Dapper's QuerySingle<int> throws). State that the async transaction helpers check the token after the action and send the commit without it. Correct the sentence that said a struct's own parameterless constructor is not called (it is), and the test that claimed the same. Add two lines to the constructor rule (a record with a second public constructor; an all-optional constructor is not parameterless) and one to the exclusion recipe (new(nameof(X.Member), null) needs no null!). Every new claim has a sample check. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…s it) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
States the NULL policy and the async transaction token behaviour correctly, and fixes a wrong sentence about a struct's own parameterless constructor, so newcomers read facts that match the code.
What changed
mapping.md"NULL in a non-nullable column"; the table row, the matching andrequiredbullets, the single-value bullet and the Dapper comparison now link to it instead of restating it. It gains the single-value case:Map<int>().Single()over a NULL is0,Map<int?>()andMap<string>()givenull.coming-from-dapper.mdsays Dapper'sQuerySingle<int>over a NULL throws. That page's link also pointed to "Types and NULL" (a section about value conversion that says nothing about NULL); it now points to "NULL in a non-nullable column".foundation.md"Transactions" says the token is checked after the action returns (a cancelled token throws and nothing commits) and the commit is sent without the token. New async sampletransaction_async.mapping.mdsaid a struct's own public parameterless constructor is not called; it is (new T()). The sentence is fixed, and the testAStructWithAPublicParameterlessConstructor_IsBuiltWithItnow asserts a side effect only the constructor can produce, not onlyId == 7.new(nameof(X.Member), null)needs nonull!.whats-new-11.md(the release PR writes the notes), the three pages on reading output values back, anything underSource/.Verification
Program.cs; check-only models inConstructorRules.cs; a commit-token recorder inTransactions.cs):dotnet run --project docsite/samples -c Releaseends withAll 125 sample checks passed.int0,int?andstringnull); DapperQuerySingle<int>over NULL throws; the exclusion pair leaves the member unmapped while a column of that name exists and the others map; a record with a second constructor and an all-optional constructor are rejected; a record with a parameterless second constructor uses it; the async transaction commits; a token cancelled in the action throwsOperationCanceledExceptionand rolls back; the commit receives a token that cannot be cancelled although a live token was passed.dotnet test Tests/Open.Database.Extensions.Core.Tests -c Release --filter UnmappableTypeTests: 213 passed on net10.0 and on net11.0.Build succeeded, 0 warnings, 0 errors.quick-check.ps1: Release build 0 warnings, 0 errors, format style and analyzers clean.Not done / decisions
mapping.mdand the existing NULL text inwhats-new-11.mdstill restate parts of the NULL rule; left alone on purpose (a different cut of the rule, and the release PR owns the notes).🤖 Generated with Claude Code