- Notifications
You must be signed in to change notification settings - Fork311
Merge | SqlBuffer#3368
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merge | SqlBuffer#3368
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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 two .NET Framework–specific methods (SetToDate
andSetToDateTime2
) into the commonSqlBuffer
class and removes the separate NetFX partial file and its csproj include, reducing code duplication.
- Converted
internal sealed partial class SqlBuffer
to a single class and added#if NETFRAMEWORK
guards around the two date methods. - Deleted
SqlBuffer.netfx.cs
and removed its compile entry from the NetFX project file. - No behavioral changes; class still builds under all TFMs.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlBuffer.cs | Removedpartial keyword, inlined NetFX methods with#if NETFRAMEWORK |
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlBuffer.netfx.cs | Deleted redundant NetFX partial file |
src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj | Removed<Compile Include="SqlBuffer.netfx.cs" /> |
Comments suppressed due to low confidence (2)
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlBuffer.cs:1262
- These new methods lack direct unit tests—add tests to verify that
SetToDate
andSetToDateTime2
correctly set internal fields for various inputs.
internal void SetToDateTime2(DateTime dateTime, byte scale)
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlBuffer.cs:1242
- [nitpick] Consider adding XML doc comments to explain what
SetToDate
does and any expectations (e.g., valid date range).
internal void SetToDate(DateTime date)
codecovbot commentedMay 22, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## main #3368 +/- ##==========================================+ Coverage 67.04% 67.08% +0.04%========================================== Files 300 299 -1 Lines 65376 65376 ==========================================+ Hits 43831 43860 +29+ Misses 21545 21516 -29
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:
|
9ef7f78
intomainUh oh!
There was an error while loading.Please reload this page.
Description
The SqlBuffer class has a netfx-specific partial with two methods in it. We can easily add them to the common project SqlBuffer class and remove the netfx partial. That is exactly what this PR does.
Issues
Assists with#1261
Testing
Project still builds, no changes to the functionality of the code at all.