Repository navigation
Correct SqlBatch command behavior exception documentation - #4878
Conversation
Align validator and reader documentation with ArgumentOutOfRangeException and supported batch behavior values without changing runtime behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: ad84379d-8a20-4ea9-adbb-bd206096530a
There was a problem hiding this comment.
🔵 Needs a closer look
Reported milestone validation failure and pending build checks remain unresolved in the available evidence.
No open issues 🎉
What changed in this PR
Corrects SqlBatch exception documentation to match the existing contract, addressing #4823 without runtime or API changes.
Changes:
- Lists all supported batch behaviors and their valid combination.
- Documents
ArgumentOutOfRangeExceptionon behavior-taking reader methods. - Clarifies synchronous validation versus task-based exception reporting.
| File | Description |
|---|---|
| src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlBatch.cs | Corrects the validation helper’s XML comment. |
| doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml | Aligns public reader documentation with existing behavior. |
Review effort: Balanced
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #4878 +/- ##
==========================================
- Coverage 72.40% 65.51% -6.90%
==========================================
Files 292 286 -6
Lines 45471 68617 +23146
==========================================
+ Hits 32924 44951 +12027
- Misses 12547 23666 +11119
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
SqlBatch.ValidateExecuteCommandBehaviordocumentsNotSupportedException, but invalid or unsupported behavior values throwArgumentOutOfRangeException. Align the source comment and public XML documentation with the existing contract.Default,SequentialAccess,CloseConnection, and the combination of the two flags.ExecuteReaderAsyncversus task-based exception reporting in the protected async wrapper.Documentation only; no runtime behavior, public API signatures, or helper names change.
Issues
Fixes #4823
Testing
.\eng\pipelines\onebranch\scripts\validate-xml-docs.ps1 -SnippetsDirectory .\doc\snippets- passed across 99 files. Reported 15 informational unprefixed-cref notices in unrelated snippets.git --no-pager diff --check- passed.No unit or integration tests were added or run, and no driver build was run, because this is a documentation-only correction. Existing
SqlBatchTestassertions already cover invalid and unsupported values throwingArgumentOutOfRangeException.Guidelines
Please review the contribution guidelines before submitting a pull request: