Merged
Conversation
…tation in SqlClientFactory
…l free to argue with me.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR removes the unused GreenMethods class and integrates its functionality directly into SqlClientFactory with a simplified lazy-loading implementation. Key changes include:
- Elimination of the GreenMethods class.
- Incorporation of lazy initialization for provider service types within SqlClientFactory.
- Simplification of error message documentation and reduction of redundant reflection code.
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlClientFactory.cs | Merges GreenMethods functionality into SqlClientFactory and refactors service resolution logic. |
| src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/Common/GreenMethods.cs | Removes the deprecated GreenMethods class as it is no longer needed. |
Files not reviewed (1)
- src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj: Language not supported
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3254 +/- ##
==========================================
+ Coverage 72.82% 72.94% +0.12%
==========================================
Files 298 297 -1
Lines 59614 59614
==========================================
+ Hits 43411 43483 +72
+ Misses 16203 16131 -72
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:
|
mdaigle
approved these changes
Apr 3, 2025
paulmedynski
approved these changes
Apr 8, 2025
This was referenced Jul 25, 2025
Open
This was referenced Jan 12, 2026
This was referenced Jan 19, 2026
This was referenced Jan 26, 2026
This was referenced Feb 2, 2026
Closed
This was referenced Feb 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description: There was an oddly named
GreenMethodsin the common namespace for the netfx project. Upon inspection, the code was only being used in SqlClientFactory, so I rolled that into the SqlClientFactory. Not only that, but I simplified the implementation quite a bit by usingLazyobjects (which was sort of called for in the original comments). A permission attribute about reflection was removed in the process and if it turns out this was super important, I can roll these changes back to a more traditional merge.As such, the
GreenMethodsclass is removed 🚮