-
Notifications
You must be signed in to change notification settings - Fork 314
Merge | SqlCommand Scalar Methods #3619
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
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 refactors the SqlCommand class by extracting scalar execution methods into a separate partial class file to improve code organization and maintainability. The change moves all ExecuteScalar-related methods from the platform-specific files into a shared partial class.
- Extracts ExecuteScalar methods into a new shared partial class file SqlCommand.Scalar.cs
- Consolidates duplicate scalar execution logic from both .NET Framework and .NET Core implementations
- Removes scalar execution code from platform-specific SqlCommand files
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
SqlCommand.Scalar.cs | New shared partial class containing all scalar execution methods |
SqlCommand.netfx.cs | Removes ExecuteScalar and related methods (moved to shared partial) |
SqlCommand.netcore.cs | Removes ExecuteScalar and related methods (moved to shared partial) |
Microsoft.Data.SqlClient.csproj (netfx) | Adds reference to new shared partial class file |
Microsoft.Data.SqlClient.csproj (netcore) | Adds reference to new shared partial class file |
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Scalar.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Scalar.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Scalar.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Scalar.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Scalar.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Scalar.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Scalar.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Scalar.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Scalar.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Scalar.cs
Outdated
Show resolved
Hide resolved
* Restore comment re: async untyped value getter * Flip order of correlation event and trace event * Introduce netfx style of result, success, return
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3619 +/- ##
==========================================
- Coverage 68.30% 65.68% -2.63%
==========================================
Files 276 277 +1
Lines 61641 61593 -48
==========================================
- Hits 42105 40455 -1650
- Misses 19536 21138 +1602
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
Welcome to the next installment of SqlCommand merge PRs. This PR addresses merging of ExecuteScalar and related methods. This begins another organizational step of creating separate partial classes for different large blocks of code. This introduces the .Scalar partial that contains methods that only pertain to executing scalars. Code that is shared across types of execution will remain in the main partial, as will all member variables and properties. Without some division like this, the SqlCommand file will be over 10k lines long and become incredibly difficult to navigate. Feel free to propose alternatives.
This PR merges:
Issues
Continuing work on #1261
Testing
Projects continue to build, and SqlCommandTests pass locally. CI will complete the validation.