Skip to content

Commit

Permalink
Replace System.Data.SqlClient with Microsoft.Data.SqlClient (#2)
Browse files Browse the repository at this point in the history
* Replace System.Data.SqlClient with Microsoft.Data.SqlClient: https://devblogs.microsoft.com/dotnet/introducing-the-new-microsoftdatasqlclient/
* Update packages
* Fix things related to new latest Kros.KORM
* Version 1.9.0
  • Loading branch information
satano authored Dec 13, 2019
1 parent a4ace12 commit 8ad3954
Show file tree
Hide file tree
Showing 10 changed files with 224 additions and 123 deletions.
50 changes: 42 additions & 8 deletions src/Kros.KORM.MsAccess.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,54 @@
</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Kros.KORM, Version=3.9.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Kros.KORM.3.9.0\lib\net46\Kros.KORM.dll</HintPath>
<Reference Include="Kros.KORM, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Kros.KORM.4.0.0-alpha.14\lib\net46\Kros.KORM.dll</HintPath>
</Reference>
<Reference Include="Kros.Utils, Version=1.9.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Kros.Utils.1.9.0\lib\net46\Kros.Utils.dll</HintPath>
<Reference Include="Kros.Utils, Version=1.11.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Kros.Utils.1.11.0\lib\net46\Kros.Utils.dll</HintPath>
</Reference>
<Reference Include="Kros.Utils.MsAccess, Version=1.6.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Kros.Utils.MsAccess.1.6.2\lib\net46\Kros.Utils.MsAccess.dll</HintPath>
<Reference Include="Kros.Utils.MsAccess, Version=1.8.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Kros.Utils.MsAccess.1.8.0\lib\net46\Kros.Utils.MsAccess.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.SqlClient, Version=1.10.19324.4, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.SqlClient.1.1.0\lib\net46\Microsoft.Data.SqlClient.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Identity.Client, Version=3.0.8.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Identity.Client.3.0.8\lib\net45\Microsoft.Identity.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.JsonWebTokens, Version=5.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.JsonWebTokens.5.5.0\lib\net451\Microsoft.IdentityModel.JsonWebTokens.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Logging, Version=5.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.Logging.5.5.0\lib\net451\Microsoft.IdentityModel.Logging.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Protocols, Version=5.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.Protocols.5.5.0\lib\net451\Microsoft.IdentityModel.Protocols.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect, Version=5.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.Protocols.OpenIdConnect.5.5.0\lib\net451\Microsoft.IdentityModel.Protocols.OpenIdConnect.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Tokens, Version=5.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.Tokens.5.5.0\lib\net451\Microsoft.IdentityModel.Tokens.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Data.Common, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.Common.4.3.0\lib\net451\System.Data.Common.dll</HintPath>
</Reference>
<Reference Include="System.Data.SqlClient, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.SqlClient.4.5.0\lib\net46\System.Data.SqlClient.dll</HintPath>
<Reference Include="System.Drawing" />
<Reference Include="System.IdentityModel" />
<Reference Include="System.IdentityModel.Tokens.Jwt, Version=5.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\System.IdentityModel.Tokens.Jwt.5.5.0\lib\net451\System.IdentityModel.Tokens.Jwt.dll</HintPath>
</Reference>
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
Expand All @@ -90,4 +117,11 @@
<Content Include="Resources\SqlIdGeneratorTableScript.sql" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Microsoft.Data.SqlClient.SNI.1.1.0\build\net46\Microsoft.Data.SqlClient.SNI.targets" Condition="Exists('..\packages\Microsoft.Data.SqlClient.SNI.1.1.0\build\net46\Microsoft.Data.SqlClient.SNI.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Data.SqlClient.SNI.1.1.0\build\net46\Microsoft.Data.SqlClient.SNI.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Data.SqlClient.SNI.1.1.0\build\net46\Microsoft.Data.SqlClient.SNI.targets'))" />
</Target>
</Project>
7 changes: 4 additions & 3 deletions src/Kros.KORM.MsAccess.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
<iconUrl>https://en.gravatar.com/userimage/137934964/524e95fbd8c2e8779e02819ab6902bef.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>$description$</description>
<copyright>Copyright © KROS a.s.</copyright>
<copyright>Copyright © KROS a. s.</copyright>
<tags>Kros;KORM;ORM;Database;DAL;SQL;Database;MSSQL;Data;BulkInsert;BulkOperation;BulkCopy;
BulkUpdate;Bulk Insert;Bulk Update;MsAccess;</tags>
<releaseNotes>https://github.com/Kros-sk/Kros.KORM.MsAccess/releases</releaseNotes>
<dependencies>
<dependency id="Kros.Utils.MsAccess" version="1.6.2" />
<dependency id="Kros.KORM" version="3.7.2" />
<dependency id="Kros.Utils" version="1.11.0" />
<dependency id="Kros.Utils.MsAccess" version="1.8.0" />
<dependency id="Kros.KORM" version="4.0.0-alpha.14" />
</dependencies>
</metadata>
</package>
8 changes: 4 additions & 4 deletions src/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
[assembly: AssemblyTitle("Kros.KORM.MsAccess")]
[assembly: AssemblyDescription("KORM.MsAccess is fast, easy to use, micro .NET ORM tool for MsAccess. (Kros Object Relation Mapper)")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("KROS a.s.")]
[assembly: AssemblyCompany("KROS a. s.")]
[assembly: AssemblyProduct("Kros.KORM.MsAccess")]
[assembly: AssemblyCopyright("Copyright © KROS a.s.")]
[assembly: AssemblyCopyright("Copyright © KROS a. s.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.8.0.0")]
[assembly: AssemblyFileVersion("1.8.0.0")]
[assembly: AssemblyVersion("1.9.0.0")]
[assembly: AssemblyFileVersion("1.9.0.0")]
19 changes: 12 additions & 7 deletions src/Query/Providers/MsAccessQueryProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
using Kros.Data.Schema.MsAccess;
using Kros.KORM.Helper;
using Kros.KORM.Materializer;
using Kros.KORM.Metadata;
using Kros.KORM.Query.Sql;
using System.Configuration;
using System.Data.Common;
using System.Data.OleDb;

Expand All @@ -24,12 +24,14 @@ public class MsAccessQueryProvider : QueryProvider
/// <param name="sqlGeneratorFactory">The SQL generator factory.</param>
/// <param name="modelBuilder">The model builder.</param>
/// <param name="logger">The logger.</param>
/// <param name="databaseMapper">The Database mapper.</param>
public MsAccessQueryProvider(
ConnectionStringSettings connectionString,
KormConnectionSettings connectionString,
ISqlExpressionVisitorFactory sqlGeneratorFactory,
IModelBuilder modelBuilder,
ILogger logger)
: base(connectionString, sqlGeneratorFactory, modelBuilder, logger)
ILogger logger,
IDatabaseMapper databaseMapper)
: base(connectionString, sqlGeneratorFactory, modelBuilder, logger, databaseMapper)
{
}

Expand All @@ -40,11 +42,14 @@ public MsAccessQueryProvider(
/// <param name="sqlGeneratorFactory">The SQL generator factory.</param>
/// <param name="modelBuilder">The model builder.</param>
/// <param name="logger">The logger.</param>
public MsAccessQueryProvider(DbConnection connection,
/// <param name="databaseMapper">The Database mapper.</param>
public MsAccessQueryProvider(
DbConnection connection,
ISqlExpressionVisitorFactory sqlGeneratorFactory,
IModelBuilder modelBuilder,
ILogger logger)
: base(connection, sqlGeneratorFactory, modelBuilder, logger)
ILogger logger,
IDatabaseMapper databaseMapper)
: base(connection, sqlGeneratorFactory, modelBuilder, logger, databaseMapper)
{
}

Expand Down
7 changes: 3 additions & 4 deletions src/Query/Providers/MsAccessQueryProviderFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Kros.KORM.Materializer;
using Kros.KORM.Metadata;
using Kros.KORM.MsAccess.Query.Sql;
using System.Configuration;
using System.Data.Common;
using System.Data.OleDb;

Expand All @@ -26,7 +25,7 @@ public class MsAccessQueryProviderFactory : IQueryProviderFactory
/// </returns>
public IQueryProvider Create(DbConnection connection, IModelBuilder modelBuilder, IDatabaseMapper databaseMapper)
=> new MsAccessQueryProvider(
connection, new MsAccessSqlExpressionVisitorFactory(databaseMapper), modelBuilder, new Logger());
connection, new MsAccessSqlExpressionVisitorFactory(databaseMapper), modelBuilder, new Logger(), databaseMapper);

/// <summary>
/// Creates the specified MsAccess QueryProvider factory.
Expand All @@ -38,11 +37,11 @@ public IQueryProvider Create(DbConnection connection, IModelBuilder modelBuilder
/// Instance of <see cref="MsAccessQueryProvider"/>.
/// </returns>
public IQueryProvider Create(
ConnectionStringSettings connectionString,
KormConnectionSettings connectionString,
IModelBuilder modelBuilder,
IDatabaseMapper databaseMapper)
=> new MsAccessQueryProvider(
connectionString, new MsAccessSqlExpressionVisitorFactory(databaseMapper), modelBuilder, new Logger());
connectionString, new MsAccessSqlExpressionVisitorFactory(databaseMapper), modelBuilder, new Logger(), databaseMapper);

/// <summary>
/// Registers instance of this type to <see cref="QueryProviderFactories"/>.
Expand Down
19 changes: 14 additions & 5 deletions src/packages.config
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Kros.KORM" version="3.9.0" targetFramework="net46" />
<package id="Kros.Utils" version="1.9.0" targetFramework="net46" />
<package id="Kros.Utils.MsAccess" version="1.6.2" targetFramework="net46" />
<package id="Kros.KORM" version="4.0.0-alpha.14" targetFramework="net46" />
<package id="Kros.Utils" version="1.11.0" targetFramework="net46" />
<package id="Kros.Utils.MsAccess" version="1.8.0" targetFramework="net46" />
<package id="Microsoft.Data.SqlClient" version="1.1.0" targetFramework="net46" />
<package id="Microsoft.Data.SqlClient.SNI" version="1.1.0" targetFramework="net46" />
<package id="Microsoft.Identity.Client" version="3.0.8" targetFramework="net46" />
<package id="Microsoft.IdentityModel.JsonWebTokens" version="5.5.0" targetFramework="net46" />
<package id="Microsoft.IdentityModel.Logging" version="5.5.0" targetFramework="net46" />
<package id="Microsoft.IdentityModel.Protocols" version="5.5.0" targetFramework="net46" />
<package id="Microsoft.IdentityModel.Protocols.OpenIdConnect" version="5.5.0" targetFramework="net46" />
<package id="Microsoft.IdentityModel.Tokens" version="5.5.0" targetFramework="net46" />
<package id="Newtonsoft.Json" version="10.0.1" targetFramework="net46" />
<package id="System.Data.Common" version="4.3.0" targetFramework="net46" />
<package id="System.Data.SqlClient" version="4.5.0" targetFramework="net46" />
<package id="System.Reflection.Emit.Lightweight" version="4.3.0" targetFramework="net46" />
<package id="System.IdentityModel.Tokens.Jwt" version="5.5.0" targetFramework="net46" />
<package id="System.Reflection.Emit.Lightweight" version="4.6.0" targetFramework="net46" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net46" />
</packages>
Loading

0 comments on commit 8ad3954

Please sign in to comment.