Skip to content

AddParam(name, DbType, direction) works on the SQL Server commands, so an output parameter no longer carries the enum as its value - #89

Merged
electricessence merged 1 commit into
masterfrom
split/02-sql-addparam-direction
Nov 9, 2026
Merged

electricessence merged 1 commit into
masterfrom
split/02-sql-addparam-direction

Conversation

@electricessence

Copy link
Copy Markdown
Collaborator

On ExpressiveSqlCommand (System.Data.SqlClient and Microsoft.Data.SqlClient) the database type is SqlDbType, so AddParam("@o", DbType.Int32, ParameterDirection.Output) bound to the object overload and sent the DbType enum as the parameter VALUE.

This adds AddParam(string, DbType, ParameterDirection) and AddParamIf(bool, string, DbType, ParameterDirection) to both commands. The DbType is converted to the SqlDbType the provider maps it to, and the parameter has no value (NULL of that type for input or input-output). The direction has no default on purpose, so a literal 0 still means a value.

Tests: SqlServerParameterTypeTests covers both packages (the second through an extern alias) and pins the calls that must keep their meaning, a literal 0 above all. The test project reference to Microsoft.Data.SqlClient gets Aliases="mssql" for that.
Verified: 0 warnings and 0 errors in Release and Debug, 8737 tests pass in both, 86 sample checks, DocFX 0 warnings, style and analyzers 0 findings.

🤖 Generated with Claude Code

…s, so an output parameter no longer sends the enum as its value

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@electricessence
electricessence merged commit 9adfac2 into master Nov 9, 2026
2 checks passed
@electricessence
electricessence deleted the split/02-sql-addparam-direction branch November 9, 2026 15:42
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