Skip to content

Commit d9d24d9

Browse files
janrybkaJan Rybka
authored and
Jan Rybka
committed
Update from System.Data.SqlClient to Microsoft.Data.SqlClient
1 parent 51ad107 commit d9d24d9

File tree

18 files changed

+57
-12
lines changed

18 files changed

+57
-12
lines changed

Source/EventFlow.MongoDB.Tests/EventFlow.MongoDB.Tests.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
55
<IsPackable>False</IsPackable>
6+
<NoWarn>NU1903</NoWarn> <!-- MongoDB.Driver is outdated and update requires .NetFramework update -->
67
</PropertyGroup>
78

89
<ItemGroup>

Source/EventFlow.MongoDB/EventFlow.MongoDB.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<PackageTags>CQRS ES event sourcing MongoDB</PackageTags>
2323
<PackageReleaseNotes>UPDATED BY BUILD</PackageReleaseNotes>
2424
<IsPackable>true</IsPackable>
25+
<NoWarn>NU1903</NoWarn> <!-- MongoDB.Driver is outdated and update requires .NetFramework update -->
2526
</PropertyGroup>
2627

2728
<ItemGroup>

Source/EventFlow.MsSql/Connections/MsSqlConnectionFactory.cs

+4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@
2121
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2222

2323
using System.Data;
24+
#if NETSTANDARD2_0_OR_GREATER
25+
using Microsoft.Data.SqlClient;
26+
#else
2427
using System.Data.SqlClient;
28+
#endif
2529
using System.Threading;
2630
using System.Threading.Tasks;
2731

Source/EventFlow.MsSql/EventFlow.MsSql.csproj

+8-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,15 @@
2121
<IsPackable>true</IsPackable>
2222
</PropertyGroup>
2323

24-
<ItemGroup>
24+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
25+
<PackageReference Include="dbup-sqlserver" Version="5.0.40" />
26+
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.0" />
27+
</ItemGroup>
28+
<ItemGroup Condition="'$(TargetFramework)' != 'netstandard2.0'">
2529
<PackageReference Include="dbup-sqlserver" Version="4.1.0" />
30+
</ItemGroup>
31+
32+
<ItemGroup>
2633
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
2734
</ItemGroup>
2835

Source/EventFlow.MsSql/EventStores/MsSqlEventPersistence.cs

+4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222

2323
using System;
2424
using System.Collections.Generic;
25+
#if NETSTANDARD2_0_OR_GREATER
26+
using Microsoft.Data.SqlClient;
27+
#else
2528
using System.Data.SqlClient;
29+
#endif
2630
using System.Linq;
2731
using System.Threading;
2832
using System.Threading.Tasks;

Source/EventFlow.MsSql/Integrations/TableParameter.cs

+8
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,20 @@
2323
using System;
2424
using System.Collections.Generic;
2525
using System.Data;
26+
#if NETSTANDARD2_0_OR_GREATER
27+
using Microsoft.Data.SqlClient;
28+
#else
2629
using System.Data.SqlClient;
30+
#endif
2731
using System.IO;
2832
using System.Linq;
2933
using System.Reflection;
3034
using Dapper;
35+
#if NETSTANDARD2_0_OR_GREATER
36+
using Microsoft.Data.SqlClient.Server;
37+
#else
3138
using Microsoft.SqlServer.Server;
39+
#endif
3240

3341
namespace EventFlow.MsSql.Integrations
3442
{

Source/EventFlow.MsSql/RetryStrategies/MsSqlErrorRetryStrategy.cs

+4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323
using System;
2424
using System.Collections.Generic;
2525
using System.ComponentModel;
26+
#if NETSTANDARD2_0_OR_GREATER
27+
using Microsoft.Data.SqlClient;
28+
#else
2629
using System.Data.SqlClient;
30+
#endif
2731
using System.Linq;
2832
using EventFlow.Core;
2933
using EventFlow.Logs;

Source/EventFlow.MsSql/SnapshotStores/MsSqlSnapshotPersistence.cs

+4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@
2121
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2222

2323
using System;
24+
#if NETSTANDARD2_0_OR_GREATER
25+
using Microsoft.Data.SqlClient;
26+
#else
2427
using System.Data.SqlClient;
28+
#endif
2529
using System.Linq;
2630
using System.Threading;
2731
using System.Threading.Tasks;

Source/EventFlow.Owin.Tests/EventFlow.Owin.Tests.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
66
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
77
<IsPackable>False</IsPackable>
8+
<NoWarn>NU1903</NoWarn> <!--Microsoft.Owin is outdated and update requires Autofac and a lot more to update -->
89
</PropertyGroup>
910
<ItemGroup>
1011
<Folder Include="Properties\" />

Source/EventFlow.Owin/EventFlow.Owin.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<NeutralLanguage>en-US</NeutralLanguage>
2020
<PackageReleaseNotes>UPDATED BY BUILD</PackageReleaseNotes>
2121
<IsPackable>true</IsPackable>
22+
<NoWarn>NU1903</NoWarn> <!--Microsoft.Owin is outdated and update requires Autofac and a lot more to update -->
2223
</PropertyGroup>
2324

2425
<ItemGroup>

Source/EventFlow.SQLite/EventFlow.SQLite.csproj

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
</PropertyGroup>
2323

2424
<ItemGroup>
25-
<PackageReference Include="dbup-sqlserver" Version="4.1.0" />
25+
<PackageReference Condition="'$(TargetFramework)' == 'netstandard2.0'" Include="dbup-sqlserver" Version="5.0.40" />
26+
<PackageReference Condition="'$(TargetFramework)' != 'netstandard2.0'" Include="dbup-sqlserver" Version="4.1.0" />
2627
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
2728
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.113.1" />
2829
</ItemGroup>

Source/EventFlow.Sql/EventFlow.Sql.csproj

+8-1
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,16 @@
2121
<IsPackable>true</IsPackable>
2222
</PropertyGroup>
2323

24-
<ItemGroup>
24+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
25+
<PackageReference Include="Dapper" Version="2.1.35" />
26+
<PackageReference Include="dbup-core" Version="5.0.37" />
27+
</ItemGroup>
28+
<ItemGroup Condition="'$(TargetFramework)' != 'netstandard2.0'">
2529
<PackageReference Include="Dapper" Version="1.50.2" />
2630
<PackageReference Include="dbup-core" Version="4.1.0" />
31+
</ItemGroup>
32+
33+
<ItemGroup>
2734
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
2835
<PackageReference Condition="'$(TargetFramework)' == 'netstandard1.6'" Include="System.ComponentModel.Annotations" Version="4.3.0" />
2936
<PackageReference Condition="'$(TargetFramework)' == 'netstandard2.0'" Include="System.ComponentModel.Annotations" Version="4.7.0" />

Source/EventFlow.TestHelpers/EventFlow.TestHelpers.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
3434
<PackageReference Include="Moq" Version="4.7.99" />
3535
<PackageReference Include="NUnit" Version="3.12.0" />
36-
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
36+
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.4" />
3737
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" PrivateAssets="All" />
3838
</ItemGroup>
3939

Source/EventFlow.TestHelpers/MsSql/IMsSqlDatabase.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2222

2323
using System;
24-
using System.Data.SqlClient;
24+
using Microsoft.Data.SqlClient;
2525

2626
namespace EventFlow.TestHelpers.MsSql
2727
{

Source/EventFlow.TestHelpers/MsSql/MsSqlConnectionString.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2222

2323
using System;
24-
using System.Data.SqlClient;
24+
using Microsoft.Data.SqlClient;
2525
using System.Text.RegularExpressions;
2626
using EventFlow.ValueObjects;
2727

Source/EventFlow.TestHelpers/MsSql/MsSqlDatabase.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2222

2323
using System;
24-
using System.Data.SqlClient;
24+
using Microsoft.Data.SqlClient;
2525

2626
namespace EventFlow.TestHelpers.MsSql
2727
{

Source/EventFlow.TestHelpers/MsSql/MsSqlHelpz.cs

+6-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2222

2323
using System;
24-
using System.Data.SqlClient;
24+
using Microsoft.Data.SqlClient;
2525
using System.Linq;
2626

2727
namespace EventFlow.TestHelpers.MsSql
@@ -49,7 +49,8 @@ public static MsSqlConnectionString CreateConnectionString(string label)
4949
{
5050
DataSource = FirstNonEmpty(
5151
Environment.GetEnvironmentVariable("EVENTFLOW_MSSQL_SERVER"),
52-
".")
52+
"."),
53+
Encrypt = false
5354
};
5455

5556
var password = Environment.GetEnvironmentVariable("EVENTFLOW_MSSQL_PASS");
@@ -82,9 +83,10 @@ public static MsSqlConnectionString CreateConnectionString(string label)
8283

8384
connectionStringBuilder.InitialCatalog = databaseName;
8485

85-
Console.WriteLine($"Using connection string for tests: {connectionStringBuilder.ConnectionString}");
86+
var connectionString = connectionStringBuilder.ConnectionString;
87+
Console.WriteLine($"Using connection string for tests: {connectionString}");
8688

87-
return new MsSqlConnectionString(connectionStringBuilder.ConnectionString);
89+
return new MsSqlConnectionString(connectionString);
8890
}
8991

9092
private static bool IsGoodConnectionString(string connectionString)

Source/EventFlow/Core/ReflectionHelper.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public static TResult CompileMethodInvocation<TResult>(MethodInfo methodInfo)
8282
throw new ArgumentException("Incorrect number of arguments");
8383
}
8484

85-
var instanceArgument = Expression.Parameter(genericArguments[0]);;
85+
var instanceArgument = Expression.Parameter(genericArguments[0]);
8686

8787
var argumentPairs = funcArgumentList.Zip(methodArgumentList, (s, d) => new {Source = s, Destination = d}).ToList();
8888
if (argumentPairs.All(a => a.Source == a.Destination))

0 commit comments

Comments
 (0)