Commit ef70686
fix: make connection optional when literal connection string is configured
When SqlCommandProvider or SqlProgrammabilityProvider is configured with
a literal connection string at design time, the connection parameter in
the generated constructor/factory method was incorrectly required. This
meant users had to pass an open SqlConnection even when a literal
connection string was available.
The fix makes the connection parameter always optional (defaulting to
null). The existing body2 logic already handles null by falling back to
the design-time connection string expression, so no further changes
are needed.
Users can now call:
AdventureWorks.CreateCommand<"SELECT ...">().Execute()
instead of having to first open a SqlConnection.
Closes #245
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent f8a4561 commit ef70686
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
652 | 652 | | |
653 | 653 | | |
654 | 654 | | |
655 | | - | |
| 655 | + | |
656 | 656 | | |
657 | 657 | | |
658 | 658 | | |
| |||
0 commit comments