Skip to content
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

Merge some netcore and netfx files #871

Merged
merged 3 commits into from
Mar 29, 2021
Merged

Conversation

Wraith2
Copy link
Contributor

@Wraith2 Wraith2 commented Jan 9, 2021

SqlCollection and SqlParameter were defined over two files in both solutions and some of the files were in different places. They are now defined in a single file each. SqlParameterCollection is now shared between both implementations. SqlParameter is not shared because there are differences; is sql 2005 supported in this library? Some other files have been changed to support the major files being merged.

The majority of changes are SqlParameter and looking at those diffs is very difficult. I suggest pulling the changed files locally and reviewing the files themselves.

@@ -730,7 +730,7 @@ override public string CommandText
{
SqlClientEventSource.Log.TryTraceEvent("<sc.SqlCommand.set_CommandText|API> {0}, String Value = '{1}'", ObjectID, value);

if (0 != ADP.SrcCompare(_commandText, value))
if (_commandText != value)
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems unrelated?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sort of. The intent was to clean up ADP as well but the PR was getting too large and complicated so I stopped part way. This change on it's own isn't harmful though so I left it in.

Functions like SrcCompare and DestCompare which just do string comparisons don't really have any benefit to being functions instead of inline, they're trivial and not worth the extra effort required to investigate what they're doing.

Base automatically changed from master to main March 15, 2021 17:54
@cheenamalhotra cheenamalhotra added this to the 3.0.0-preview2 milestone Mar 18, 2021
@Wraith2
Copy link
Contributor Author

Wraith2 commented Mar 22, 2021

@cheenamalhotra any chance of getting this PR reviewed next? I've got a few things I'd like to be able to change in SqlParameter that it's blocking.

Copy link
Contributor

@David-Engel David-Engel left a comment

Choose a reason for hiding this comment

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

Apart from the minor nit-pick issues, LGTM.

I know we have a lot of these types of refactors ahead of us. As a suggestion for future ones, it might be helpful to reviewers to break the refactor into multiple steps/commits. For example, keep any method/property re-ordering to a single commit without other changes. That way someone can review each commit to see a "no change" re-order commit, followed by a commit that has cleanup of code within the methods. This will make it much easier to identify potential differences that may introduce bugs and give us more confidence in approving them.

I do appreciate the work!

Comment on lines 436 to 438
<Compile Include="Microsoft\Data\SqlClient\SqlCommand.cs">
<SubType>Component</SubType>
</Compile>
Copy link
Contributor

Choose a reason for hiding this comment

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

Revert these subtype component changes.

I wish there was a way to tell VS to stop trying to turn these classes into Components...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Me too. The only say i've found to deal with them is to keep the project unloaded but that isn't helpful when trying to merge thing. They're cleared.

Copy link

Choose a reason for hiding this comment

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

untested drive-by... but: adding [System.ComponentModel.DesignerCategory("")] to the class seems to be the magic incantation :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll give that a try, thanks.

@David-Engel
Copy link
Contributor

is sql 2005 supported in this library?

To answer your question, no. We only have to support versions that are within extended support (10 years). So SQL 2012 and up, at this point.

@Wraith2
Copy link
Contributor Author

Wraith2 commented Mar 27, 2021

is sql 2005 supported in this library?

To answer your question, no. We only have to support versions that are within extended support (10 years). So SQL 2012 and up, at this point.

In a future merge the 2005 code can be dropped then.

As a suggestion for future ones, it might be helpful to reviewers to break the refactor into multiple steps/commits.

This one did end up being too large. I've tried to keep subsequent ones smaller. I'll bear in mind the phased approach in future.

@cheenamalhotra cheenamalhotra merged commit db21ad0 into dotnet:main Mar 29, 2021
@Wraith2 Wraith2 deleted the combine12 branch June 29, 2021 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants