-
Notifications
You must be signed in to change notification settings - Fork 315
Merge | SqlCommand Execute Reader #3644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* Make both arguments required # Conflicts: # src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Reader.cs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR consolidates all SqlCommand ExecuteReader-related methods and functionality into a new shared partial class file (SqlCommand.Reader.cs). It removes duplicate implementations from both .NET Framework and .NET Core platform-specific files, eliminating code duplication and centralizing the ExecuteReader logic.
- Merges 30+ ExecuteReader-related methods from platform-specific files into a shared implementation
- Updates method signatures to make parameters required and clarify usage patterns
- Adds the new shared file to both platform-specific project files
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
SqlCommand.Reader.cs | New shared partial containing all ExecuteReader methods and supporting infrastructure |
SqlCommand.NonQuery.cs | Updates CompleteAsyncExecuteReader call to use new required parameter signature |
SqlCommand.netfx.cs | Removes duplicated ExecuteReader methods and classes, updates CompleteAsyncExecuteReader calls |
SqlCommand.netcore.cs | Removes duplicated ExecuteReader methods and classes, updates CompleteAsyncExecuteReader calls |
Microsoft.Data.SqlClient.csproj (netfx) | Adds reference to new shared SqlCommand.Reader.cs file |
Microsoft.Data.SqlClient.csproj (netcore) | Adds reference to new shared SqlCommand.Reader.cs file |
Comments suppressed due to low confidence (1)
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Reader.cs:1
- The TODO comment expresses confusion about the logic. Since this is in a text command execution path, the comment is correct that CommandType should never be StoredProcedure here. Consider removing this parameter or clarifying the logic.
// Licensed to the .NET Foundation under one or more agreements.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Reader.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Reader.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Reader.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Reader.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Reader.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Reader.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Reader.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Reader.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Reader.cs
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3644 +/- ##
===========================================
- Coverage 90.82% 77.16% -13.66%
===========================================
Files 6 274 +268
Lines 316 45659 +45343
===========================================
+ Hits 287 35233 +34946
- Misses 29 10426 +10397
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
In this installment of merging SqlCommand, the focus is on the ExecuteReader methods and supporting structures. As with previous PRs in this series, a new partial has been introduced for the Reader methods. Every commit is a bite-sized merge of a single method or so. This is probably the largest of the partials due to the many methods that make up execution of readers. It can definitely be simplified by using proper async primitives, and I have plans to do so. Please also take special look at this PR since all the other execute partials call into this partial.
The following methods were merged:
And also the ExecuteReaderAsyncCallContext internal class
Issues
Continuation of work for #1261
Testing
Code still compiles, CI suite will validate