Repository navigation
AddParam(value) finds a stored procedure's real parameter names on any DbConnection - #91
Merged
Merged
Conversation
…y DbConnection ExpressiveCommand and ExpressiveDbCommand now read the names from the ADO.NET ProcedureParameters schema collection (SQL Server supports it), so a parameter added with AddParam(value) is matched to the procedure's declared parameter. A provider without the collection, a name with a database part, or a name found in several schemas gives no names, and the last member of the argument is used as written. 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.
AddParam(value)on a stored procedure needs the procedure's declared parameter names, and only a provider-specific override could supply them, so onExpressiveCommandandExpressiveDbCommandthe last member of the argument was always used as written.Both commands now read the names from the ADO.NET
ProcedureParametersschema collection (SQL Server supports it), through a new internalProcedureSchemaNames. A name with a database part, a name found in several schemas, or a provider without the collection gives no names and falls back to the old behaviour. A failed lookup is thrown as it is (aDbExceptionstays one), with the procedure name added toException.Data["Procedure"]. The three new overrides are added toPublicAPI.Shipped.txt.Tests:
ProcedureSchemaNamesTestshas 20 tests over a fake schema provider (no database needed). Release and Debug: 8778 passed, 0 failed; build 0 warnings, 0 errors; docs samples 86 checks pass; DocFX 0 warnings; style and analyzers 0 findings.🤖 Generated with Claude Code