Skip to content

Commit ec8ca55

Browse files
benrr101Ben Russell
andauthored
Merge | SqlDataSourceEnumerator.Unix.cs (#3335)
* Rename SqlDataSourceEnumeratorManagedHelper.cs to indicate it is only used in netcore project * Move SqlDataSourceEnumerator.Unix.cs to SqlDataSourceEnumerator.netcore.Unix.cs in common project * Fix broken doc link --------- Co-authored-by: Ben Russell <ben@holycrapitsbenrussell>
1 parent b3a72fc commit ec8ca55

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@
152152
<Compile Include="$(CommonSourceRoot)Microsoft\Data\Sql\SqlDataSourceEnumerator.cs">
153153
<Link>Microsoft\Data\Sql\SqlDataSourceEnumerator.cs</Link>
154154
</Compile>
155-
<Compile Include="$(CommonSourceRoot)Microsoft\Data\Sql\SqlDataSourceEnumeratorManagedHelper.cs">
156-
<Link>Microsoft\Data\Sql\SqlDataSourceEnumeratorManagedHelper.cs</Link>
155+
<Compile Include="$(CommonSourceRoot)Microsoft\Data\Sql\SqlDataSourceEnumeratorManagedHelper.netcore.cs">
156+
<Link>Microsoft\Data\Sql\SqlDataSourceEnumeratorManagedHelper.netcore.cs</Link>
157157
</Compile>
158158
<Compile Include="$(CommonSourceRoot)Microsoft\Data\Sql\SqlDataSourceEnumeratorUtil.cs">
159159
<Link>Microsoft\Data\Sql\SqlDataSourceEnumeratorUtil.cs</Link>
@@ -865,15 +865,15 @@
865865
<Compile Include="$(CommonSourceRoot)Microsoft\Data\Common\AdapterUtil.Windows.cs">
866866
<Link>Microsoft\Data\Common\AdapterUtil.Windows.cs</Link>
867867
</Compile>
868-
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\ConnectionPool\DbConnectionPoolIdentity.Windows.cs">
869-
<Link>Microsoft\Data\SqlClient\ConnectionPool\DbConnectionPoolIdentity.Windows.cs</Link>
870-
</Compile>
871868
<Compile Include="$(CommonSourceRoot)Microsoft\Data\Sql\SqlDataSourceEnumeratorNativeHelper.cs">
872869
<Link>Microsoft\Data\Sql\SqlDataSourceEnumeratorNativeHelper.cs</Link>
873870
</Compile>
874871
<Compile Include="$(CommonSourceRoot)Microsoft\Data\Sql\SqlDataSourceEnumerator.Windows.cs">
875872
<Link>Microsoft\Data\Sql\SqlDataSourceEnumerator.Windows.cs</Link>
876873
</Compile>
874+
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\ConnectionPool\DbConnectionPoolIdentity.Windows.cs">
875+
<Link>Microsoft\Data\SqlClient\ConnectionPool\DbConnectionPoolIdentity.Windows.cs</Link>
876+
</Compile>
877877
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\LocalDb\LocalDbApi.Windows.cs">
878878
<Link>Microsoft\Data\SqlClient\LocalDb\LocalDbApi.Windows.cs</Link>
879879
</Compile>
@@ -915,6 +915,9 @@
915915
<Compile Include="$(CommonSourceRoot)Microsoft\Data\Common\AdapterUtil.Unix.cs">
916916
<Link>Microsoft\Data\Common\AdapterUtil.Unix.cs</Link>
917917
</Compile>
918+
<Compile Include="$(CommonSourceRoot)Microsoft\Data\Sql\SqlDataSourceEnumerator.netcore.Unix.cs">
919+
<Link>Microsoft\Data\Sql\SqlDataSourceEnumerator.netcore.Unix.cs</Link>
920+
</Compile>
918921
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\ConnectionPool\DbConnectionPoolIdentity.Unix.cs">
919922
<Link>Microsoft\Data\SqlClient\ConnectionPool\DbConnectionPoolIdentity.Unix.cs</Link>
920923
</Compile>
@@ -942,8 +945,7 @@
942945
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlTypes\SqlFileStream.netcore.Unix.cs">
943946
<Link>Microsoft\Data\SqlTypes\SqlFileStream.netcore.Unix.cs</Link>
944947
</Compile>
945-
946-
<Compile Include="Microsoft\Data\Sql\SqlDataSourceEnumerator.Unix.cs" />
948+
947949
<Compile Include="Microsoft\Data\SqlClient\SNI\LocalDB.Unix.cs" />
948950
<Compile Include="Microsoft\Data\SqlClient\TdsParser.Unix.cs" />
949951
</ItemGroup>
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
4+
5+
#if NET
6+
47
using System.Data;
58
using System.Data.Common;
69
using Microsoft.Data.SqlClient.Server;
710

811
namespace Microsoft.Data.Sql
912
{
10-
/// <include file='../../../../doc/snippets/Microsoft.Data.Sql/SqlDataSourceEnumerator.xml' path='docs/members[@name="SqlDataSourceEnumerator"]/SqlDataSourceEnumerator/*' />
13+
/// <include file='../../../../../../doc/snippets/Microsoft.Data.Sql/SqlDataSourceEnumerator.xml' path='docs/members[@name="SqlDataSourceEnumerator"]/SqlDataSourceEnumerator/*' />
1114
public sealed partial class SqlDataSourceEnumerator : DbDataSourceEnumerator
1215
{
1316
private partial DataTable GetDataSourcesInternal() => SqlDataSourceEnumeratorManagedHelper.GetDataSources();
1417
}
1518
}
19+
20+
#endif

src/Microsoft.Data.SqlClient/src/Microsoft/Data/Sql/SqlDataSourceEnumeratorManagedHelper.cs renamed to src/Microsoft.Data.SqlClient/src/Microsoft/Data/Sql/SqlDataSourceEnumeratorManagedHelper.netcore.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
4+
5+
#if NET
6+
47
using System.Collections.Generic;
58
using System.Data;
69
using Microsoft.Data.Sql;
@@ -73,3 +76,5 @@ private static DataTable ParseServerEnumString(string serverInstances)
7376
}
7477
}
7578
}
79+
80+
#endif

0 commit comments

Comments
 (0)