From 0c6d484d0b3b0652115bcd2ce8d2630bad5114d7 Mon Sep 17 00:00:00 2001 From: Jan Rybka Date: Tue, 2 Apr 2024 20:26:21 +0200 Subject: [PATCH] Update from System.Data.SqlClient to Microsoft.Data.SqlClient --- .../Connections/MsSqlConnectionFactory.cs | 2 +- Source/EventFlow.MsSql/EventFlow.MsSql.csproj | 3 ++- .../EventStores/MsSqlEventPersistence.cs | 2 +- Source/EventFlow.MsSql/Integrations/TableParameter.cs | 4 ++-- .../RetryStrategies/MsSqlErrorRetryStrategy.cs | 2 +- .../SnapshotStores/MsSqlSnapshotPersistence.cs | 2 +- Source/EventFlow.Sql/EventFlow.Sql.csproj | 4 ++-- .../EventFlow.TestHelpers/EventFlow.TestHelpers.csproj | 2 +- Source/EventFlow.TestHelpers/MsSql/IMsSqlDatabase.cs | 2 +- .../MsSql/MsSqlConnectionString.cs | 2 +- Source/EventFlow.TestHelpers/MsSql/MsSqlDatabase.cs | 2 +- Source/EventFlow.TestHelpers/MsSql/MsSqlHelpz.cs | 10 ++++++---- 12 files changed, 20 insertions(+), 17 deletions(-) diff --git a/Source/EventFlow.MsSql/Connections/MsSqlConnectionFactory.cs b/Source/EventFlow.MsSql/Connections/MsSqlConnectionFactory.cs index 31c230cac..91d3c8bc6 100644 --- a/Source/EventFlow.MsSql/Connections/MsSqlConnectionFactory.cs +++ b/Source/EventFlow.MsSql/Connections/MsSqlConnectionFactory.cs @@ -21,7 +21,7 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. using System.Data; -using System.Data.SqlClient; +using Microsoft.Data.SqlClient; using System.Threading; using System.Threading.Tasks; diff --git a/Source/EventFlow.MsSql/EventFlow.MsSql.csproj b/Source/EventFlow.MsSql/EventFlow.MsSql.csproj index 76079208a..ff686d64c 100644 --- a/Source/EventFlow.MsSql/EventFlow.MsSql.csproj +++ b/Source/EventFlow.MsSql/EventFlow.MsSql.csproj @@ -12,7 +12,8 @@ - + + diff --git a/Source/EventFlow.MsSql/EventStores/MsSqlEventPersistence.cs b/Source/EventFlow.MsSql/EventStores/MsSqlEventPersistence.cs index 07e850d6b..9c95e4649 100644 --- a/Source/EventFlow.MsSql/EventStores/MsSqlEventPersistence.cs +++ b/Source/EventFlow.MsSql/EventStores/MsSqlEventPersistence.cs @@ -22,7 +22,7 @@ using System; using System.Collections.Generic; -using System.Data.SqlClient; +using Microsoft.Data.SqlClient; using System.Linq; using System.Threading; using System.Threading.Tasks; diff --git a/Source/EventFlow.MsSql/Integrations/TableParameter.cs b/Source/EventFlow.MsSql/Integrations/TableParameter.cs index 90528d529..0d014ab6a 100644 --- a/Source/EventFlow.MsSql/Integrations/TableParameter.cs +++ b/Source/EventFlow.MsSql/Integrations/TableParameter.cs @@ -23,12 +23,12 @@ using System; using System.Collections.Generic; using System.Data; -using System.Data.SqlClient; using System.IO; using System.Linq; using System.Reflection; using Dapper; -using Microsoft.SqlServer.Server; +using Microsoft.Data.SqlClient; +using Microsoft.Data.SqlClient.Server; namespace EventFlow.MsSql.Integrations { diff --git a/Source/EventFlow.MsSql/RetryStrategies/MsSqlErrorRetryStrategy.cs b/Source/EventFlow.MsSql/RetryStrategies/MsSqlErrorRetryStrategy.cs index ac4493045..8db12c86e 100644 --- a/Source/EventFlow.MsSql/RetryStrategies/MsSqlErrorRetryStrategy.cs +++ b/Source/EventFlow.MsSql/RetryStrategies/MsSqlErrorRetryStrategy.cs @@ -23,7 +23,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; -using System.Data.SqlClient; +using Microsoft.Data.SqlClient; using System.Linq; using EventFlow.Core; using Microsoft.Extensions.Logging; diff --git a/Source/EventFlow.MsSql/SnapshotStores/MsSqlSnapshotPersistence.cs b/Source/EventFlow.MsSql/SnapshotStores/MsSqlSnapshotPersistence.cs index c50b2eb5e..44ff3d9f2 100644 --- a/Source/EventFlow.MsSql/SnapshotStores/MsSqlSnapshotPersistence.cs +++ b/Source/EventFlow.MsSql/SnapshotStores/MsSqlSnapshotPersistence.cs @@ -21,7 +21,7 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. using System; -using System.Data.SqlClient; +using Microsoft.Data.SqlClient; using System.Linq; using System.Threading; using System.Threading.Tasks; diff --git a/Source/EventFlow.Sql/EventFlow.Sql.csproj b/Source/EventFlow.Sql/EventFlow.Sql.csproj index 664158a98..1f6164a38 100644 --- a/Source/EventFlow.Sql/EventFlow.Sql.csproj +++ b/Source/EventFlow.Sql/EventFlow.Sql.csproj @@ -12,8 +12,8 @@ - - + + diff --git a/Source/EventFlow.TestHelpers/EventFlow.TestHelpers.csproj b/Source/EventFlow.TestHelpers/EventFlow.TestHelpers.csproj index 4053a9f66..a8c2dc13f 100644 --- a/Source/EventFlow.TestHelpers/EventFlow.TestHelpers.csproj +++ b/Source/EventFlow.TestHelpers/EventFlow.TestHelpers.csproj @@ -22,7 +22,7 @@ - + diff --git a/Source/EventFlow.TestHelpers/MsSql/IMsSqlDatabase.cs b/Source/EventFlow.TestHelpers/MsSql/IMsSqlDatabase.cs index 185edf59a..6bfa388c3 100644 --- a/Source/EventFlow.TestHelpers/MsSql/IMsSqlDatabase.cs +++ b/Source/EventFlow.TestHelpers/MsSql/IMsSqlDatabase.cs @@ -21,7 +21,7 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. using System; -using System.Data.SqlClient; +using Microsoft.Data.SqlClient; namespace EventFlow.TestHelpers.MsSql { diff --git a/Source/EventFlow.TestHelpers/MsSql/MsSqlConnectionString.cs b/Source/EventFlow.TestHelpers/MsSql/MsSqlConnectionString.cs index b20f3d7e9..f6f671bee 100644 --- a/Source/EventFlow.TestHelpers/MsSql/MsSqlConnectionString.cs +++ b/Source/EventFlow.TestHelpers/MsSql/MsSqlConnectionString.cs @@ -21,7 +21,7 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. using System; -using System.Data.SqlClient; +using Microsoft.Data.SqlClient; using System.Text.RegularExpressions; using EventFlow.ValueObjects; diff --git a/Source/EventFlow.TestHelpers/MsSql/MsSqlDatabase.cs b/Source/EventFlow.TestHelpers/MsSql/MsSqlDatabase.cs index 6ae21d96e..04ab988a3 100644 --- a/Source/EventFlow.TestHelpers/MsSql/MsSqlDatabase.cs +++ b/Source/EventFlow.TestHelpers/MsSql/MsSqlDatabase.cs @@ -21,7 +21,7 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. using System; -using System.Data.SqlClient; +using Microsoft.Data.SqlClient; namespace EventFlow.TestHelpers.MsSql { diff --git a/Source/EventFlow.TestHelpers/MsSql/MsSqlHelpz.cs b/Source/EventFlow.TestHelpers/MsSql/MsSqlHelpz.cs index f3c085ceb..8851d6cb8 100644 --- a/Source/EventFlow.TestHelpers/MsSql/MsSqlHelpz.cs +++ b/Source/EventFlow.TestHelpers/MsSql/MsSqlHelpz.cs @@ -21,7 +21,7 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. using System; -using System.Data.SqlClient; +using Microsoft.Data.SqlClient; using System.Linq; namespace EventFlow.TestHelpers.MsSql @@ -49,7 +49,8 @@ public static MsSqlConnectionString CreateConnectionString(string label) { DataSource = FirstNonEmpty( Environment.GetEnvironmentVariable("EVENTFLOW_MSSQL_SERVER"), - ".") + "."), + Encrypt = false }; var password = Environment.GetEnvironmentVariable("EVENTFLOW_MSSQL_PASS"); @@ -82,9 +83,10 @@ public static MsSqlConnectionString CreateConnectionString(string label) connectionStringBuilder.InitialCatalog = databaseName; - Console.WriteLine($"Using connection string for tests: {connectionStringBuilder.ConnectionString}"); + var connectionString = connectionStringBuilder.ConnectionString; + Console.WriteLine($"Using connection string for tests: {connectionString}"); - return new MsSqlConnectionString(connectionStringBuilder.ConnectionString); + return new MsSqlConnectionString(connectionString); } private static bool IsGoodConnectionString(string connectionString)