Skip to content

Conversation

benrr101
Copy link
Contributor

@benrr101 benrr101 commented Jun 3, 2025

Description

In the previous PR, we moved the debug-only code for DbConnectionOptions into its own partial class and renamed the remaining partials to follow the merge pattern (ie, *.netcore.cs and *.netfx.cs). This PR completes the process by moving the platform-specific partials into the common DbConnectionOptions.cs file. The code is wrapped in pre-processor directives to ensure they are only compiled on the appropriate platforms.

Issues

Continues work towards #1261

Testing

Code has moved but the functionality has not changed. Project still builds, and CI should be enough for validation.

@Copilot Copilot AI review requested due to automatic review settings June 3, 2025 16:14
@benrr101 benrr101 added the Common Project 🚮 Things that relate to the common project project label Jun 3, 2025
@benrr101 benrr101 requested a review from a team as a code owner June 3, 2025 16:14
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 consolidates the platform-specific partial classes for DbConnectionOptions into a single common file using preprocessor directives, removing the need for separate .netfx and .netcore files. Key changes include merging platform-specific code into DbConnectionOptions.cs, removing the obsolete partial files, and updating the project files to reflect these deletions.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/ConnectionString/DbConnectionOptions.cs Merged platform-specific code with preprocessor directives; added a TODO comment regarding parser extraction.
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/Common/ConnectionString/DbConnectionOptions.netfx.cs Removed as its contents are now merged into the common DbConnectionOptions.cs file.
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Common/ConnectionString/DbConnectionOptions.netcore.cs Removed as its contents are now merged into the common DbConnectionOptions.cs file.
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient.csproj Updated to remove reference to the .netfx partial class file.
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient.csproj Updated to remove reference to the .netcore partial class file.

mdaigle
mdaigle previously approved these changes Jun 3, 2025
Copy link
Contributor

@mdaigle mdaigle left a comment

Choose a reason for hiding this comment

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

From a pure merge perspective, it looks good to me. Interested in some of the additional improvements that @edwardneal has suggested.

Copy link

codecov bot commented Jun 3, 2025

Codecov Report

Attention: Patch coverage is 80.28169% with 14 lines in your changes missing coverage. Please review.

Project coverage is 68.20%. Comparing base (e649a7c) to head (30d7989).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...ata/Common/ConnectionString/DbConnectionOptions.cs 80.28% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3388      +/-   ##
==========================================
- Coverage   68.33%   68.20%   -0.14%     
==========================================
  Files         301      299       -2     
  Lines       65631    65406     -225     
==========================================
- Hits        44849    44608     -241     
- Misses      20782    20798      +16     
Flag Coverage Δ
addons 92.58% <ø> (ø)
netcore 68.78% <100.00%> (-3.83%) ⬇️
netfx 70.65% <77.77%> (+3.66%) ⬆️

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.

paulmedynski
paulmedynski previously approved these changes Jun 10, 2025
@benrr101 benrr101 dismissed stale reviews from paulmedynski and mdaigle via 30d7989 June 11, 2025 23:41
@benrr101 benrr101 merged commit 2385ca7 into main Jun 12, 2025
251 checks passed
@benrr101 benrr101 deleted the dev/russellben/merge/dbconnectionoptions-platform-specific branch June 12, 2025 16:42
@paulmedynski paulmedynski added this to the 6.1-preview2 milestone Jun 23, 2025
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.

4 participants