Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update from System.Data.SqlClient to Microsoft.Data.SqlClient in v0.x #1027

Open
wants to merge 1 commit into
base: develop-v0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="NEST" Version="7.8.2" />
<PackageReference Include="newtonsoft.json" Version="11.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Source/EventFlow.Hangfire/EventFlow.Hangfire.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<ItemGroup>
<PackageReference Include="Hangfire.Core" Version="1.6.20" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="newtonsoft.json" Version="11.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
<IsPackable>False</IsPackable>
<NoWarn>NU1903</NoWarn> <!-- MongoDB.Driver is outdated and update requires .NetFramework update -->
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions Source/EventFlow.MongoDB/EventFlow.MongoDB.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<PackageTags>CQRS ES event sourcing MongoDB</PackageTags>
<PackageReleaseNotes>UPDATED BY BUILD</PackageReleaseNotes>
<NoWarn>NU1903</NoWarn> <!-- MongoDB.Driver is outdated and update requires .NetFramework update -->
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions Source/EventFlow.MsSql/Connections/MsSqlConnectionFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

using System.Data;
#if NETSTANDARD2_0_OR_GREATER
using Microsoft.Data.SqlClient;
#else
using System.Data.SqlClient;
#endif
using System.Threading;
using System.Threading.Tasks;

Expand Down
9 changes: 8 additions & 1 deletion Source/EventFlow.MsSql/EventFlow.MsSql.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,15 @@
<PackageReleaseNotes>UPDATED BY BUILD</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="dbup-sqlserver" Version="5.0.40" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'netstandard2.0'">
<PackageReference Include="dbup-sqlserver" Version="4.1.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>

Expand Down
4 changes: 4 additions & 0 deletions Source/EventFlow.MsSql/EventStores/MsSqlEventPersistence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@

using System;
using System.Collections.Generic;
#if NETSTANDARD2_0_OR_GREATER
using Microsoft.Data.SqlClient;
#else
using System.Data.SqlClient;
#endif
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
Expand Down
8 changes: 8 additions & 0 deletions Source/EventFlow.MsSql/Integrations/TableParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,20 @@
using System;
using System.Collections.Generic;
using System.Data;
#if NETSTANDARD2_0_OR_GREATER
using Microsoft.Data.SqlClient;
#else
using System.Data.SqlClient;
#endif
using System.IO;
using System.Linq;
using System.Reflection;
using Dapper;
#if NETSTANDARD2_0_OR_GREATER
using Microsoft.Data.SqlClient.Server;
#else
using Microsoft.SqlServer.Server;
#endif

namespace EventFlow.MsSql.Integrations
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
#if NETSTANDARD2_0_OR_GREATER
using Microsoft.Data.SqlClient;
#else
using System.Data.SqlClient;
#endif
using System.Linq;
using EventFlow.Core;
using EventFlow.Logs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

using System;
#if NETSTANDARD2_0_OR_GREATER
using Microsoft.Data.SqlClient;
#else
using System.Data.SqlClient;
#endif
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
Expand Down
1 change: 1 addition & 0 deletions Source/EventFlow.Owin.Tests/EventFlow.Owin.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<IsPackable>False</IsPackable>
<NoWarn>NU1903</NoWarn> <!--Microsoft.Owin is outdated and update requires Autofac and a lot more to update -->
</PropertyGroup>
<ItemGroup>
<Folder Include="Properties\" />
Expand Down
1 change: 1 addition & 0 deletions Source/EventFlow.Owin/EventFlow.Owin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<NeutralLanguage>en-US</NeutralLanguage>
<PackageReleaseNotes>UPDATED BY BUILD</PackageReleaseNotes>
<NoWarn>NU1903</NoWarn> <!--Microsoft.Owin is outdated and update requires Autofac and a lot more to update -->
</PropertyGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion Source/EventFlow.SQLite/EventFlow.SQLite.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="dbup-sqlserver" Version="4.1.0" />
<PackageReference Condition="'$(TargetFramework)' == 'netstandard2.0'" Include="dbup-sqlserver" Version="5.0.40" />
<PackageReference Condition="'$(TargetFramework)' != 'netstandard2.0'" Include="dbup-sqlserver" Version="4.1.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.113.1" />
</ItemGroup>
Expand Down
9 changes: 8 additions & 1 deletion Source/EventFlow.Sql/EventFlow.Sql.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,16 @@
<PackageReleaseNotes>UPDATED BY BUILD</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Dapper" Version="2.1.35" />
<PackageReference Include="dbup-core" Version="5.0.37" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'netstandard2.0'">
<PackageReference Include="Dapper" Version="1.50.2" />
<PackageReference Include="dbup-core" Version="4.1.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Condition="'$(TargetFramework)' == 'netstandard1.6'" Include="System.ComponentModel.Annotations" Version="4.3.0" />
<PackageReference Condition="'$(TargetFramework)' == 'netstandard2.0'" Include="System.ComponentModel.Annotations" Version="4.7.0" />
Expand Down
2 changes: 1 addition & 1 deletion Source/EventFlow.TestHelpers/EventFlow.TestHelpers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Moq" Version="4.7.99" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.3.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.4" />
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" PrivateAssets="All" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion Source/EventFlow.TestHelpers/MsSql/IMsSqlDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion Source/EventFlow.TestHelpers/MsSql/MsSqlDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
10 changes: 6 additions & 4 deletions Source/EventFlow.TestHelpers/MsSql/MsSqlHelpz.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Source/EventFlow/Core/ReflectionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static TResult CompileMethodInvocation<TResult>(MethodInfo methodInfo)
throw new ArgumentException("Incorrect number of arguments");
}

var instanceArgument = Expression.Parameter(genericArguments[0]);;
var instanceArgument = Expression.Parameter(genericArguments[0]);

var argumentPairs = funcArgumentList.Zip(methodArgumentList, (s, d) => new {Source = s, Destination = d}).ToList();
if (argumentPairs.All(a => a.Source == a.Destination))
Expand Down
2 changes: 1 addition & 1 deletion Source/EventFlow/EventFlow.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.4.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="JetBrains.Annotations" Version="11.0.0">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
Expand Down