- Notifications
You must be signed in to change notification settings - Fork311
Merge | AssemblyCache#3236
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
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 moves the AssemblyCache class from the netfx project to the common project and makes a couple of low-impact adjustments.
- Moved the AssemblyCache class to the common project and made it static.
- Removed the outdated AssemblyCache implementation from the netfx project.
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/AssemblyCache.netfx.cs | Added and updated AssemblyCache to be static in the common project |
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/assemblycache.cs | Removed the old AssemblyCache file from the netfx project |
Files not reviewed (1)
- src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj: Language not supported
Debug.Assert(t != null, "Type object cant be NULL"); | ||
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.
[nitpick] Consider updating the assertion message to include an apostrophe (e.g. "Type object can't be null") for clarity.
Debug.Assert(t!=null,"Type objectcant be NULL"); | |
Debug.Assert(t!=null,"Type objectcan't be NULL"); |
Copilot uses AI. Check for mistakes.
codecovbot commentedMar 21, 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 #3236 +/- ##==========================================- Coverage 72.72% 72.65% -0.07%========================================== Files 303 302 -1 Lines 59712 59714 +2 ==========================================- Hits 43426 43386 -40- Misses 16286 16328 +42
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:
|
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/AssemblyCache.netfx.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/AssemblyCache.netfx.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
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.
Looks good as is for a pure move. But I also agree with@edwardneal 's method cleanup suggestion.
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 removes the AssemblyCache class and its usages, merging its remaining functionality directly into SqlConnection and SqlParameter.
- Removed dependency on AssemblyCache in SqlConnection by inlining the GetInfoFromType logic.
- Updated SqlParameter to call SerializationHelperSql9.SizeInBytes instead of using the AssemblyCache branch.
- Deleted the AssemblyCache source file.
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlConnection.cs | Replaced AssemblyCache.GetInfoFromType with an inline helper method. |
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlParameter.cs | Removed conditional branch and now uses SerializationHelperSql9.SizeInBytes directly. |
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/assemblycache.cs | Entire file removed as part of deprecation. |
Files not reviewed (1)
- src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj: Language not supported
Comments suppressed due to low confidence (2)
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlConnection.cs:2728
- [nitpick] Consider renaming GetInfoFromType to GetSqlUdtInfoFromType to more clearly indicate its purpose.
SqlUdtInfo attr = GetInfoFromType(o.GetType());
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlParameter.cs:1616
- Verify that SerializationHelperSql9.SizeInBytes handles all cases previously managed by AssemblyCache.GetLength, particularly on the NETFX target.
coercedSize = SerializationHelperSql9.SizeInBytes(val);
e4cda4a
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Description: Moving one small class from netfx project to common project. I made a couple changes to it along the way:Removed comments that make literally no sense anymoreMade the class static (it only has two static methods in it anymore)Couple low-impact stylistic changesChange In Plans! Let's just get rid of AssemblyCache! The two remaining methods in the class have been rolled into the respective class they were called in. GetSize was rolled into SqlParameter (only place it was used), GetType was rolled into SqlConnection (which now matches netcore implementation). AssemblyCache was deleted.
Testing: Just moving things around.Still no funny business here.