-
Notifications
You must be signed in to change notification settings - Fork 310
Merge | SqlConnectionFactory #3420
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
…tionFactory class Align netcore and netfx versions to make merge really easy
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 merges the SqlConnectionFactory implementations from the netfx and netcore projects into a unified implementation in the common project. It removes redundant overloads in the connection creation methods and updates project files accordingly.
- Merged SqlConnectionFactory into a single common implementation.
- Dropped the overload of CreateConnection that did not accept user connection options.
- Updated project files to reference the unified implementation and remove legacy netfx-specific files.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
SqlInternalConnectionTds.stub.cs | Adds a stub for SqlInternalConnectionTds; note a potential typo in the constructor name. |
SqlConnectionFactory.cs | Unifies connection factory logic, replaces overloads and updates AssemblyLoadContext subscriptions. |
SqlConnection.stub.cs | Updates SqlConnection to inherit from DbConnection and adds internal properties. |
SessionData.stub.cs | Adds a stub for SessionData. |
DbConnectionFactory.cs | Adjusts the abstract CreateConnection signature to include userOptions. |
netfx/SqlConnectionFactory.cs | Removes the netfx-specific implementation. |
netfx/SqlConnectionFactory.csproj | Updates to reference the common SqlConnectionFactory. |
netcore/SqlConnectionFactory.AssemblyLoadContext.cs | Removes duplicate AssemblyLoadContext handling, migrating to the common file. |
netcore/SqlClient.csproj | Updates to reference the common SqlConnectionFactory and remove the duplicate AssemblyLoadContext file. |
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlInternalConnectionTds.stub.cs
Outdated
Show resolved
Hide resolved
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3420 +/- ##
==========================================
+ Coverage 63.51% 67.64% +4.13%
==========================================
Files 293 291 -2
Lines 63810 63677 -133
==========================================
+ Hits 40526 43074 +2548
+ Misses 23284 20603 -2681
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:
|
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.
Style/consistency questions.
Description
Does what it says on the tin - merges the SqlConnectionFactory class from the netfx and netcore projects into a single implementation in the common project.
One noteworthy change that's a biiit outside the scope: There were two overloads of CreateConnection in SqlConnectionFactory and DbConnectionFactory, one that takes user connection options one that does not. The one that does not, would just call into the one that does passing null as the user connection options. This was confused by the fact that both methods are virtual. To make this easier, I just dropped the overload that doesn't take user connection options, and made the implementation in the base class abstract.
Issues
Continues work on #1261
Testing
Code moved, it still compiles, shouldn't be any issues.