Skip to content

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

Merged
merged 9 commits into from
Jun 23, 2025
Merged

Conversation

benrr101
Copy link
Contributor

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.

@benrr101 benrr101 added this to the 7.0-preview1 milestone Jun 13, 2025
@Copilot Copilot AI review requested due to automatic review settings June 13, 2025 21:14
@benrr101 benrr101 requested a review from a team as a code owner June 13, 2025 21:14
@benrr101 benrr101 added the Common Project 🚮 Things that relate to the common project project label Jun 13, 2025
Copy link
Contributor

@Copilot Copilot AI left a 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.

Copy link

codecov bot commented Jun 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.64%. Comparing base (12f742d) to head (0e180b2).
Report is 1 commits behind head on main.

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     
Flag Coverage Δ
addons 92.58% <ø> (ø)
netcore 72.64% <100.00%> (+5.70%) ⬆️
netfx 66.23% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@paulmedynski paulmedynski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/consistency questions.

paulmedynski
paulmedynski previously approved these changes Jun 16, 2025
@benrr101 benrr101 merged commit 7d809a8 into main Jun 23, 2025
251 checks passed
@benrr101 benrr101 deleted the dev/russellben/merge/sqlconnectionfactory branch June 23, 2025 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Common Project 🚮 Things that relate to the common project project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy