Skip to content

Commit 9ce7614

Browse files
authored
Merge pull request #205 from mgolois/upgrade-sqlclient-driver-to-Microsoft.Data.SqlClient
upgraded project to use the Microsoft.Data.SqlClient for .netstandard2.0
2 parents 7949c76 + 68de948 commit 9ce7614

File tree

103 files changed

+438
-179
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+438
-179
lines changed

ElasticDatabaseTools.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26730.10
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.29709.97
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.SqlDatabase.ElasticScale.Client", "Src\ElasticScale.Client\Microsoft.Azure.SqlDatabase.ElasticScale.Client.csproj", "{4C3B3EC4-5702-469E-800E-313FB27A0A2B}"
77
EndProject

Samples/Dapper/ElasticDapper.csproj

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,17 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net451</TargetFrameworks>
3+
<TargetFramework>netcoreapp3.1</TargetFramework>
44
<OutputType>Exe</OutputType>
55
</PropertyGroup>
66

77
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Build.props))\Build.props" />
88

99
<ItemGroup>
10-
<PackageReference Include="Dapper" version="1.36" />
11-
<PackageReference Include="DapperExtensions" version="1.4.4" />
12-
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling" version="6.0.1304.0" />
13-
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.Data" version="6.0.1304.1" />
14-
<PackageReference Include="Microsoft.Azure.SqlDatabase.ElasticScale.Client" version="2.0.0" />
15-
<Reference Include="System" />
16-
<Reference Include="System.ComponentModel.DataAnnotations" />
17-
<Reference Include="System.Configuration" />
18-
<Reference Include="System.Core" />
19-
<Reference Include="System.Transactions" />
20-
<Reference Include="System.Xml.Linq" />
21-
<Reference Include="System.Data.DataSetExtensions" />
22-
<Reference Include="Microsoft.CSharp" />
23-
<Reference Include="System.Data" />
24-
<Reference Include="System.Xml" />
10+
<PackageReference Include="Dapper" Version="2.0.30" />
11+
<PackageReference Include="DapperExtensions.DotnetCore" Version="1.0.1" />
12+
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.Data.NetCore" Version="6.0.1312" />
13+
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.NetCore" Version="6.0.1312" />
14+
<PackageReference Include="Microsoft.Azure.SqlDatabase.ElasticScale.Client" Version="2.3.0" />
2515
</ItemGroup>
2616

2717
<ItemGroup>

Samples/EFCodeFirst/EntityFrameworkCodeFirst.csproj

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,16 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net451</TargetFrameworks>
3+
<TargetFramework>netcoreapp3.1</TargetFramework>
44
<OutputType>Exe</OutputType>
55
</PropertyGroup>
66

77
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Build.props))\Build.props" />
88

99
<ItemGroup>
10-
<PackageReference Include="EntityFramework" Version="6.1.0" />
11-
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling" Version="6.0.1304.0" />
12-
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.Data" Version="6.0.1304.1" />
13-
<PackageReference Include="Microsoft.Azure.SqlDatabase.ElasticScale.Client" Version="2.0.0" />
14-
<Reference Include="System" />
15-
<Reference Include="System.ComponentModel.DataAnnotations" />
16-
<Reference Include="System.Configuration" />
17-
<Reference Include="System.Core" />
18-
<Reference Include="System.Transactions" />
19-
<Reference Include="System.Xml.Linq" />
20-
<Reference Include="System.Data.DataSetExtensions" />
21-
<Reference Include="Microsoft.CSharp" />
22-
<Reference Include="System.Data" />
23-
<Reference Include="System.Xml" />
10+
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.Data.NetCore" Version="6.0.1312" />
11+
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.NetCore" Version="6.0.1312" />
12+
<PackageReference Include="EntityFramework" Version="6.4.0" />
13+
<PackageReference Include="Microsoft.Azure.SqlDatabase.ElasticScale.Client" Version="2.3.0" />
2414
</ItemGroup>
2515

2616
<ItemGroup>
Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,11 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net451</TargetFrameworks>
3+
<TargetFramework>netcoreapp3.1</TargetFramework>
44
<OutputType>Exe</OutputType>
55
</PropertyGroup>
66

77
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Build.props))\Build.props" />
88

9-
<ItemGroup>
10-
<PackageReference Include="EntityFramework" Version="6.1.0" />
11-
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling" Version="6.0.1304.0" />
12-
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.Data" Version="6.0.1304.1" />
13-
<PackageReference Include="Microsoft.Azure.SqlDatabase.ElasticScale.Client" Version="2.0.0" />
14-
<Reference Include="System" />
15-
<Reference Include="System.ComponentModel.DataAnnotations" />
16-
<Reference Include="System.Configuration" />
17-
<Reference Include="System.Core" />
18-
<Reference Include="System.Transactions" />
19-
<Reference Include="System.Xml.Linq" />
20-
<Reference Include="System.Data.DataSetExtensions" />
21-
<Reference Include="Microsoft.CSharp" />
22-
<Reference Include="System.Data" />
23-
<Reference Include="System.Xml" />
24-
</ItemGroup>
25-
269
<ItemGroup>
2710
<None Include="App.config" />
2811
<None Include="ApplySqlToShards.ps1" />
@@ -33,4 +16,11 @@
3316
<Content Include="EnableRLS.sql" />
3417
<Content Include="RemoveRLS.sql" />
3518
</ItemGroup>
19+
20+
<ItemGroup>
21+
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.Data.NetCore" Version="6.0.1312" />
22+
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.NetCore" Version="6.0.1312" />
23+
<PackageReference Include="EntityFramework" Version="6.4.0" />
24+
<PackageReference Include="Microsoft.Azure.SqlDatabase.ElasticScale.Client" Version="2.3.0" />
25+
</ItemGroup>
3626
</Project>

Samples/ElasticScaleStarterKit/ElasticScaleStarterKit.csproj

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net451</TargetFrameworks>
3+
<TargetFramework>netcoreapp3.1</TargetFramework>
44
<OutputType>Exe</OutputType>
55
</PropertyGroup>
66

77
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Build.props))\Build.props" />
88

99
<ItemGroup>
10-
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling" Version="6.0.1304.0" />
11-
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.Data" Version="6.0.1304.1" />
12-
<PackageReference Include="Microsoft.Azure.SqlDatabase.ElasticScale.Client" Version="2.0.0" />
13-
<Reference Include="System" />
14-
<Reference Include="System.Configuration" />
15-
<Reference Include="System.Core" />
16-
<Reference Include="System.Xml.Linq" />
17-
<Reference Include="System.Data.DataSetExtensions" />
18-
<Reference Include="Microsoft.CSharp" />
19-
<Reference Include="System.Data" />
20-
<Reference Include="System.Xml" />
10+
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.Data.NetCore" Version="6.0.1312" />
11+
<PackageReference Include="EnterpriseLibrary.TransientFaultHandling.NetCore" Version="6.0.1312" />
12+
<PackageReference Include="EntityFramework" Version="6.4.0" />
13+
<PackageReference Include="Microsoft.Azure.SqlDatabase.ElasticScale.Client" Version="2.3.0" />
2114
</ItemGroup>
2215

2316
<ItemGroup>
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
23
<PropertyGroup>
3-
<TargetFrameworks>net451</TargetFrameworks>
4+
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
45
<OutputType>Exe</OutputType>
56
</PropertyGroup>
67

78
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Build.props))\Build.props" />
89

910
<ItemGroup>
1011
<PackageReference Include="Microsoft.Azure.SqlDatabase.ElasticScale.Client" version="2.0.0" />
11-
<Reference Include="System" />
12-
<Reference Include="System.Core" />
13-
<Reference Include="System.Data" />
14-
<Reference Include="System.Xml" />
1512
</ItemGroup>
1613

1714
<ItemGroup>
1815
<None Include="LICENSE" />
1916
</ItemGroup>
17+
2018
</Project>

Src/ElasticScale.Client/ElasticScale.Common/InternalHelpers/ApplicationNameHelper.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
// Copyright (c) Microsoft. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4+
#if NETFRAMEWORK
5+
using System.Data.SqlClient;
6+
#else
7+
using Microsoft.Data.SqlClient;
8+
#endif
49
using System;
510
using System.Collections.Generic;
6-
using System.Data.SqlClient;
711
using System.Linq;
812
using System.Text;
913
using System.Threading.Tasks;

Src/ElasticScale.Client/ElasticScale.Common/TransientFaultHandling/Implementation/SqlDatabaseTransientErrorDetectionStrategy.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212

1313
using System;
1414
using System.ComponentModel;
15-
using System.Data.SqlClient;
15+
#if NETFRAMEWORK
16+
using System.Data.SqlClient;
17+
#else
18+
using Microsoft.Data.SqlClient;
19+
#endif
1620

1721
namespace Microsoft.Azure.SqlDatabase.ElasticScale
1822
{

Src/ElasticScale.Client/ElasticScale.Common/TransientFaultHandling/Implementation/ThrottlingCondition.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212

1313
using System;
1414
using System.Collections.Generic;
15-
using System.Data.SqlClient;
15+
#if NETFRAMEWORK
16+
using System.Data.SqlClient;
17+
#else
18+
using Microsoft.Data.SqlClient;
19+
#endif
1620
using System.Globalization;
1721
using System.Linq;
1822
using System.Text;

Src/ElasticScale.Client/Microsoft.Azure.SqlDatabase.ElasticScale.Client.csproj

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,10 @@
1919
<RuntimeIdentifiers>win;unix</RuntimeIdentifiers>
2020
<RootNamespace>Microsoft.Azure.SqlDatabase.ElasticScale</RootNamespace>
2121
</PropertyGroup>
22-
22+
2323
<Import Project="$([MSBuild]::GetPathOfFileAbove('build.props'))" />
2424
<Import Project="$([MSBuild]::GetPathOfFileAbove('strongname.props'))" />
2525

26-
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
27-
<PackageReference Include="System.Data.SqlClient" Version="4.8.5" />
28-
</ItemGroup>
29-
3026
<ItemGroup>
3127
<None Include="Properties\Icon.png" Pack="true" PackagePath="\"/>
3228
<Compile Update="ShardManagement\Errors.Designer.cs">
@@ -52,4 +48,10 @@
5248
</EmbeddedResource>
5349
</ItemGroup>
5450

51+
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
52+
<PackageReference Include="Microsoft.Data.SqlClient">
53+
<Version>1.1.1</Version>
54+
</PackageReference>
55+
</ItemGroup>
56+
5557
</Project>

0 commit comments

Comments
 (0)