Skip to content

AddParam(value) finds a stored procedure's real parameter names on any DbConnection - #91

Merged
electricessence merged 1 commit into
masterfrom
split/04-procedure-schema-names
Nov 9, 2026
Merged

electricessence merged 1 commit into
masterfrom
split/04-procedure-schema-names

Conversation

@electricessence

Copy link
Copy Markdown
Collaborator

AddParam(value) on a stored procedure needs the procedure's declared parameter names, and only a provider-specific override could supply them, so on ExpressiveCommand and ExpressiveDbCommand the last member of the argument was always used as written.

Both commands now read the names from the ADO.NET ProcedureParameters schema collection (SQL Server supports it), through a new internal ProcedureSchemaNames. 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 (a DbException stays one), with the procedure name added to Exception.Data["Procedure"]. The three new overrides are added to PublicAPI.Shipped.txt.

Tests: ProcedureSchemaNamesTests has 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

…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>
@electricessence
electricessence merged commit fe72729 into master Nov 9, 2026
2 checks passed
@electricessence
electricessence deleted the split/04-procedure-schema-names branch November 9, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant