-
Notifications
You must be signed in to change notification settings - Fork 315
Merge | SqlCommand Public Methods #3655
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
Merge | SqlCommand Public Methods #3655
Conversation
# Conflicts: # src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlCommand.netfx.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 SqlCommand public methods from platform-specific files into the shared SqlCommand.cs file. The changes merge constructors, Cancel, Clone, CreateParameter, CreateDbParameter, Dispose, and various internal methods (OnDone*, OnReturn*, RegisterColumnEncryptionKeyStoreProvidersOnCommand, etc.) to eliminate code duplication between .NET Framework and .NET Core implementations.
Key changes:
- Consolidated all SqlCommand constructors into shared code
- Merged public methods like Cancel, Clone, CreateParameter, Dispose
- Unified internal methods for handling TDS protocol events
- Removed unused GetSqlParameterWithQueryText method
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.cs | Added consolidated constructors, public methods (Cancel, Clone, CreateParameter, Dispose), and internal event handlers (OnDone*, OnReturn*) |
SqlCommand.netfx.cs | Removed duplicate constructors and methods that were moved to shared file; cleaned up unused imports |
SqlCommand.netcore.cs | Removed duplicate constructors and methods that were moved to shared file; cleaned up unused imports |
TdsParserHelperClasses.cs | Added TODO comment for SqlReturnValue property improvements |
SqlQueryMetadataCache.cs | Added TODO comment to replace GetInstance method with Instance property |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3655 +/- ##
===========================================
- Coverage 90.82% 77.36% -13.46%
===========================================
Files 6 274 +268
Lines 316 45556 +45240
===========================================
+ Hits 287 35246 +34959
- Misses 29 10310 +10281
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
At this stage of the merge of SqlCommand, I'm more/less in mop-up mode. There's less obvious lines that can be drawn around code to put into partials. This PR focuses on the remaining public (and protected) methods in SqlCommand. As with all the other PRs in this series, each commit is bitesized and focuses on a single or a couple related methods at a time.
The following methods were merged in this PR:
SqlCommand constructors
Cancel
Clone
CrreateDbParameter
CreateParameter
Dispose
OnDone
OnDoneDescribeParameterEncryptionProc
OnDoneProc
OnReturnStatus
OnReturnValue
RegisterColumnEncryptionKeyStoreProvidersOnCommand
ResetCommandTimeout (I made a mistake and it isn't added to netfx until the very end)
GetSqlParameterWithQueryText - removed as it was no longer being used
Issues
Continuation of work in #1261
Testing
Build passes, SqlCommandTests pass locally. CI should validate the rest of it.