Skip to content

Commit 94a51da

Browse files
authored
Merge | SqlConnection.cs (#3608)
1 parent a9d4238 commit 94a51da

File tree

8 files changed

+237
-2677
lines changed

8 files changed

+237
-2677
lines changed

src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -919,6 +919,9 @@ public void RegisterColumnEncryptionKeyStoreProvidersOnConnection(System.Collect
919919
public int CommandTimeout { get { throw null; } }
920920
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlConnection.xml' path='docs/members[@name="SqlConnection"]/ConnectionString/*'/>
921921
[System.ComponentModel.DefaultValueAttribute("")]
922+
#pragma warning disable CS0618
923+
[System.ComponentModel.RecommendedAsConfigurableAttribute(true)]
924+
#pragma warning restore CS0618
922925
[System.ComponentModel.RefreshPropertiesAttribute(System.ComponentModel.RefreshProperties.All)]
923926
[System.ComponentModel.SettingsBindableAttribute(true)]
924927
public override string ConnectionString { get { throw null; } set { } }

src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,9 @@
585585
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SqlCommandSet.cs">
586586
<Link>Microsoft\Data\SqlClient\SqlCommandSet.cs</Link>
587587
</Compile>
588+
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SqlConnection.cs">
589+
<Link>Microsoft\Data\SqlClient\SqlConnection.cs</Link>
590+
</Compile>
588591
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SqlConnectionEncryptOption.cs">
589592
<Link>Microsoft\Data\SqlClient\SqlConnectionEncryptOption.cs</Link>
590593
</Compile>
@@ -818,7 +821,6 @@
818821
</Compile>
819822

820823
<Compile Include="Microsoft\Data\SqlClient\SqlCommand.netcore.cs" />
821-
<Compile Include="Microsoft\Data\SqlClient\SqlConnection.cs" />
822824
<Compile Include="Microsoft\Data\SqlClient\SqlConnectionHelper.cs" />
823825
<Compile Include="Microsoft\Data\SqlClient\SqlInternalConnectionTds.cs" />
824826
<Compile Include="Microsoft\Data\SqlClient\TdsParser.cs" />

src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,9 @@ public SqlConnection(string connectionString, Microsoft.Data.SqlClient.SqlCreden
800800
public int CommandTimeout { get { throw null; } }
801801
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlConnection.xml' path='docs/members[@name="SqlConnection"]/ConnectionString/*'/>
802802
[System.ComponentModel.DefaultValueAttribute("")]
803+
#pragma warning disable CS0618
804+
[System.ComponentModel.RecommendedAsConfigurableAttribute(true)]
805+
#pragma warning restore CS0618
803806
[System.ComponentModel.RefreshPropertiesAttribute(System.ComponentModel.RefreshProperties.All)]
804807
[System.ComponentModel.SettingsBindableAttribute(true)]
805808
public override string ConnectionString { get { throw null; } set { } }

src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,9 @@
756756
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SqlCommandSet.cs">
757757
<Link>Microsoft\Data\SqlClient\SqlCommandSet.cs</Link>
758758
</Compile>
759+
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SqlConnection.cs">
760+
<Link>Microsoft\Data\SqlClient\SqlConnection.cs</Link>
761+
</Compile>
759762
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SqlConnectionEncryptOption.cs">
760763
<Link>Microsoft\Data\SqlClient\SqlConnectionEncryptOption.cs</Link>
761764
</Compile>
@@ -986,7 +989,6 @@
986989
</Compile>
987990

988991
<Compile Include="Microsoft\Data\SqlClient\SqlCommand.netfx.cs" />
989-
<Compile Include="Microsoft\Data\SqlClient\SqlConnection.cs" />
990992
<Compile Include="Microsoft\Data\SqlClient\SqlConnectionHelper.cs" />
991993
<Compile Include="Microsoft\Data\SqlClient\SqlInternalConnectionTds.cs" />
992994
<Compile Include="Microsoft\Data\SqlClient\TdsParser.cs" />

src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlConnection.cs

Lines changed: 0 additions & 2544 deletions
This file was deleted.

src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlConnectionHelper.cs

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,6 @@ public SqlConnection() : base()
3636
_innerConnection = DbConnectionClosedNeverOpened.SingletonInstance;
3737
}
3838

39-
// Copy Constructor
40-
private void CopyFrom(SqlConnection connection)
41-
{ // V1.2.3300
42-
ADP.CheckArgumentNull(connection, "connection");
43-
_userConnectionOptions = connection.UserConnectionOptions;
44-
_poolGroup = connection.PoolGroup;
45-
46-
// SQLBU 432115
47-
// Match the original connection's behavior for whether the connection was never opened,
48-
// but ensure Clone is in the closed state.
49-
if (DbConnectionClosedNeverOpened.SingletonInstance == connection._innerConnection)
50-
{
51-
_innerConnection = DbConnectionClosedNeverOpened.SingletonInstance;
52-
}
53-
else
54-
{
55-
_innerConnection = DbConnectionClosedPreviouslyOpened.SingletonInstance;
56-
}
57-
}
58-
5939
/// <devdoc>We use the _closeCount to avoid having to know about all our
6040
/// children; instead of keeping a collection of all the objects that
6141
/// would be affected by a close, we simply increment the _closeCount
@@ -311,27 +291,6 @@ internal DbMetaDataFactory GetMetaDataFactoryInternal(DbConnectionInternal inter
311291
return GetMetaDataFactory(internalConnection);
312292
}
313293

314-
/// <include file='../../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlConnection.xml' path='docs/members[@name="SqlConnection"]/GetSchema2/*' />
315-
override public DataTable GetSchema()
316-
{
317-
return this.GetSchema(DbMetaDataCollectionNames.MetaDataCollections, null);
318-
}
319-
320-
/// <include file='../../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlConnection.xml' path='docs/members[@name="SqlConnection"]/GetSchemaCollectionName/*' />
321-
override public DataTable GetSchema(string collectionName)
322-
{
323-
return this.GetSchema(collectionName, null);
324-
}
325-
326-
/// <include file='../../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlConnection.xml' path='docs/members[@name="SqlConnection"]/GetSchemaCollectionNameRestrictionValues/*' />
327-
override public DataTable GetSchema(string collectionName, string[] restrictionValues)
328-
{
329-
// NOTE: This is virtual because not all providers may choose to support
330-
// returning schema data
331-
SqlConnection.ExecutePermission.Demand();
332-
return InnerConnection.GetSchema(ConnectionFactory, PoolGroup, this, collectionName, restrictionValues);
333-
}
334-
335294
internal void NotifyWeakReference(int message)
336295
{
337296
InnerConnection.NotifyWeakReference(message);

0 commit comments

Comments
 (0)