- 
                Notifications
    You must be signed in to change notification settings 
- Fork 316
Merge | SqlConnection cosmetic changes #3275
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 | SqlConnection cosmetic changes #3275
Conversation
| /azp run | 
| Azure Pipelines successfully started running 1 pipeline(s). | 
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.
Cleanup is always welcome! A couple of minor tweaks.
        
          
                src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlConnection.cs
          
            Show resolved
            Hide resolved
        
              
          
                src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlConnection.cs
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlConnection.cs
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | Codecov ReportAttention: Patch coverage is  
 
 Additional details and impacted files@@            Coverage Diff             @@
##             main    #3275      +/-   ##
==========================================
- Coverage   72.98%   66.16%   -6.83%     
==========================================
  Files         299      292       -7     
  Lines       57215    56691     -524     
==========================================
- Hits        41760    37509    -4251     
- Misses      15455    19182    +3727     
 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:
 | 
| /azp run | 
| Azure Pipelines successfully started running 1 pipeline(s). | 
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.
I think you goal here is to get one side in line with the other. In that case I can be a lot more forgiving to stuff like order of properties. No need to address the comments, just raising them as things to think on.
Otherwise, glad to get closer to merging the big beasts.
| capacity: 1, | ||
| comparer: StringComparer.OrdinalIgnoreCase); | ||
|  | ||
| internal bool ForceNewConnection | 
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.
I'm assuming the goal here is just to get it into the same place as it is in netcore? Otherwise I'd be a stickler and say properties belong after constructors
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.
Exactly - the goal's to make a Visual Studio diff useful. I've tested reordering properties, but it'd rapidly increase the size of the diff: even moving a dozen properties resulted in a 300-line change.
I agree it'd be a good idea to deal with code style fixups though. We could do this after the codebases are merged, or file-by-file through the merged codebase. The WPF repo is going through this at the moment, and the approach they've taken is dotnet/wpf#10270.
| /// <include file='../../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlConnection.xml' path='docs/members[@name="SqlConnection"]/CommandTimeout/*' /> | ||
| [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] | ||
| [ResDescription(StringsHelper.ResourceNames.SqlConnection_ConnectionTimeout)] | ||
| public int CommandTimeout | 
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.
I don't get this ordering scheme at all.... If we're just trying to get one side in line with the other side, then I won't complain. But if we're not, we've got privates before publics, properties before constructors, properties after constructors...
| } | ||
|  | ||
| if (UsesContextConnection(connectionOptions)) | ||
| else if (UsesContextConnection(connectionOptions)) | 
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.
nit: this one is one I've butted heads with people in the past. Technically, the else is redundant here since if the condition is triggered, we exit the method. In my IDE, I get notices about them, so I usually try to avoid them. But I admit, it is tidier to have the else-if chain. Though it would be even better if this could be written as a switch block :/
6ca56d0    to
    bdde88e      
    Compare
  
    | @edwardneal ok that was more dangerous, but yeahhhh I just rebased your branch off of main and fixed the merge conflicts (please don't be mad) | 
| /azp run | 
| Azure Pipelines successfully started running 1 pipeline(s). | 
| Thanks rebasing this @benrr101. I noticed that CI was failing on the netfx project, so I've adjusted it slightly. | 
Contributes to #1261.
This is easier to review commit-by-commit - it performs formatting changes, reorders members, synchronises comments and other cosmetic changes. The end result is that SqlConnection is reduced to a -315/+305 diff.
The remaining diff is 1/3 context connection handling, 1/3 logging changes, 1/6 unported performance improvements and 1/6 being the "real" set of behavioural changes.)
Could someone run CI against this please?