Repository navigation
Fix three inconsistencies found by a final pass over the published packages: the return direction in AddParameter, a canceled parameter-name lookup, and a completed transaction - #321
Merged
Conversation
…pe, direction) Old behavior: AddParameter with a null name threw ArgumentNullException for every direction, although its documentation said a null name is allowed for ReturnValue. New behavior: it passes the direction to AddParameterType, so a null name adds an unnamed return parameter and any other direction still throws; the documentation says so. Behavior change: yes (a call that threw now succeeds) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Old behavior: when the call was canceled and GetSchemaAsync threw ArgumentException, NotSupportedException or NotImplementedException, the lookup returned no names, which were kept, so later calls never looked again; the canceled call itself ran on with the names as written. New behavior: when the token is canceled, those failures end the call with OperationCanceledException and nothing is kept, as in the output-parameter metadata lookup; a failure with the token not canceled is still "no names". Behavior change: yes (only on a canceled call: it ends canceled instead of running on without the looked-up names) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… transaction Old behavior: the command constructors that take a transaction (and Command and StoredProcedure on a transaction) threw ArgumentNullException named "connection" for a completed transaction. New behavior: they throw InvalidOperationException with the existing no-connection message, as CreateCommand and DbQuery.Using do; a null transaction still throws ArgumentNullException named "transaction". Behavior change: yes (the exception type of a completed transaction changes) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Style only: braces on every block, as the repository rules ask. No behavior change. 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.
A last review of the published packages looked for the same concept handled two ways. Three inconsistencies were real bugs, each shown by a test that failed before its fix. Each fix is one commit (plus one style-only commit for the test helper), so any of them can be dropped on its own. All three change behavior.
AddParameter(name, value, type, direction)accepts anullname for a return value. The overload passed no direction to the check that allows anullname only forParameterDirection.ReturnValue, so the call threw for a return value althoughAddParameterType(and the SQL Server overload) accept it. It now passes the direction first and adds an unnamed return parameter; any other direction with anullname still throwsArgumentNullException. The parameter docs now state the rule.GetSchemaAsyncthrewArgumentException,NotSupportedExceptionorNotImplementedException, the lookup returned "no names" and kept it, so later calls of that procedure sent the names as written and never looked again. The output-parameter metadata lookup already refused to keep a canceled failure. The name lookup now ends the call withOperationCanceledExceptionand keeps nothing. A failure while the token is not canceled is still "no names".InvalidOperationException.new ExpressiveCommand(transaction, ...),ExpressiveDbCommand,ExpressiveSqlCommandand theCommandandStoredProcedureextensions ofIDbTransactionandDbTransactionthrewArgumentNullExceptionnamedconnectionfor a transaction whose connection is gone, whileCreateCommandandDbQuery.Usingon the same transaction throwInvalidOperationException. They now throwInvalidOperationExceptionwith the existing message that names the cause and the fix. Anulltransaction still throwsArgumentNullExceptionnamedtransaction. The constructor,CommandandStoredProcedureexception docs are updated.Each commit adds its bullet to the release notes.
Checks
dotnet format styleandanalyzers --severity info: 0 findings in all 14 projects.🤖 Generated with Claude Code