Skip to content

Commit

Permalink
Merge pull request #14 from linq2db/db2_iseries_support
Browse files Browse the repository at this point in the history
update version and iseries provider
  • Loading branch information
MaceWindu authored Nov 5, 2018
2 parents 57dff69 + a879731 commit eccbbbb
Show file tree
Hide file tree
Showing 10 changed files with 79 additions and 44 deletions.
Binary file removed Redist/IBM/LinqToDB.DataProvider.DB2iSeries.dll
Binary file not shown.
13 changes: 13 additions & 0 deletions Source/DriverHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using LinqToDB.Data;

using LINQPad.Extensibility.DataContext;
using System.Reflection;

namespace LinqToDB.LINQPad
{
Expand Down Expand Up @@ -176,5 +177,17 @@ public static Action<TraceInfo> GetOnTraceConnection(QueryExecutionManager execu
}
};
}

public static void ConfigureRedirects()
{
AppDomain.CurrentDomain.AssemblyResolve += (sender, args) =>
{
var requestedAssembly = new AssemblyName(args.Name);
if (requestedAssembly.Name != "linq2db")
return null;

return typeof(DataContext).Assembly;
};
}
}
}
5 changes: 5 additions & 0 deletions Source/LinqToDBDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ public class LinqToDBDriver : DynamicDataContextDriver
public override string Name => "LINQ to DB";
public override string Author => "Igor Tkachev";

static LinqToDBDriver()
{
DriverHelper.ConfigureRedirects();
}

public override string GetConnectionDescription(IConnectionInfo cxInfo)
{
var providerName = (string)cxInfo.DriverData.Element("providerName");
Expand Down
5 changes: 5 additions & 0 deletions Source/LinqToDBStaticDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ public class LinqToDBStaticDriver : StaticDataContextDriver
public override string Name => "LINQ to DB (DataConnection)";
public override string Author => "Igor Tkachev";

static LinqToDBStaticDriver()
{
DriverHelper.ConfigureRedirects();
}

public override string GetConnectionDescription(IConnectionInfo cxInfo)
{
var providerName = (string)cxInfo.DriverData.Element("providerName");
Expand Down
4 changes: 2 additions & 2 deletions Source/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,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("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyVersion("2.5.1.0")]
[assembly: AssemblyFileVersion("2.5.1.0")]
8 changes: 4 additions & 4 deletions Source/ProviderHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ static ProviderHelper()
InitializeDataProviders();
}

public static class DB2iSeriesProviderName
{
public const string DB2 = "DB2.iSeries";
public static class DB2iSeriesProviderName
{
public const string DB2 = "DB2.iSeries";
}

static void InitializeDataProviders()
Expand Down Expand Up @@ -252,4 +252,4 @@ static IDataProvider GetDataProvider(string providerName, string connectionStrin
return provider;
}
}
}
}
79 changes: 43 additions & 36 deletions Source/app.config
Original file line number Diff line number Diff line change
@@ -1,42 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</configSections>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.1.1.0" newVersion="1.1.1.0" />
</dependentAssembly>
<dependentAssembly>
<publisherPolicy apply="no" />
<assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />
<bindingRedirect oldVersion="4.121.0.0 - 4.65535.65535.65535" newVersion="4.122.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.6.0.0" newVersion="3.6.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.data>
<configSections>
<section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</configSections>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.1.1.0" newVersion="1.1.1.0" />
</dependentAssembly>
<dependentAssembly>
<publisherPolicy apply="no" />
<assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />
<bindingRedirect oldVersion="4.121.0.0 - 4.65535.65535.65535" newVersion="4.122.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.6.0.0" newVersion="3.6.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="linq2db" publicKeyToken="e41013125f9e410a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.5.1.0" newVersion="2.5.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.data>
<DbProviderFactories>


<remove invariant="Oracle.ManagedDataAccess.Client" />
<add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
<remove invariant="FirebirdSql.Data.FirebirdClient" /><add name="FirebirdClient Data Provider" invariant="FirebirdSql.Data.FirebirdClient" description=".NET Framework Data Provider for Firebird" type="FirebirdSql.Data.FirebirdClient.FirebirdClientFactory, FirebirdSql.Data.FirebirdClient" /></DbProviderFactories>
<remove invariant="FirebirdSql.Data.FirebirdClient" />
<add name="FirebirdClient Data Provider" invariant="FirebirdSql.Data.FirebirdClient" description=".NET Framework Data Provider for Firebird" type="FirebirdSql.Data.FirebirdClient.FirebirdClientFactory, FirebirdSql.Data.FirebirdClient" />
</DbProviderFactories>
</system.data>
<oracle.manageddataaccess.client>
<version number="*">
<dataSources>
<dataSource alias="SampleDataSource" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) " />
</dataSources>
</version>
</oracle.manageddataaccess.client>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /></startup></configuration>
<oracle.manageddataaccess.client>
<version number="*">
<dataSources>
<dataSource alias="SampleDataSource" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) " />
</dataSources>
</version>
</oracle.manageddataaccess.client>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
5 changes: 5 additions & 0 deletions Source/linq2db.LINQPad.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Redist\LINQPad.exe</HintPath>
</Reference>
<Reference Include="LinqToDB.DataProvider.DB2iSeries, Version=2.1.0.0, Culture=neutral, PublicKeyToken=03711e61966fa152, processorArchitecture=MSIL">
<HintPath>..\packages\linq2db4iSeries.2.5.0\lib\net45\LinqToDB.DataProvider.DB2iSeries.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CodeAnalysis, Version=1.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CodeAnalysis.Common.1.3.2\lib\net45\Microsoft.CodeAnalysis.dll</HintPath>
</Reference>
Expand Down Expand Up @@ -113,6 +116,8 @@
<Reference Include="System.Data.Entity.Design">
<Private>True</Private>
</Reference>
<Reference Include="System.Data.Linq" />
<Reference Include="System.Data.Services" />
<Reference Include="System.Data.SQLite, Version=1.0.108.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.SQLite.Core.1.0.108.0\lib\net451\System.Data.SQLite.dll</HintPath>
</Reference>
Expand Down
1 change: 1 addition & 0 deletions Source/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<package id="Google.Protobuf" version="3.6.0" targetFramework="net452" />
<package id="JetBrains.Annotations" version="2018.2.1" targetFramework="net452" />
<package id="linq2db" version="2.5.1" targetFramework="net452" />
<package id="linq2db4iSeries" version="2.5.0" targetFramework="net452" />
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net452" />
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net452" />
Expand Down
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 1.0.{build}
version: 2.5.1
os: Visual Studio 2017
configuration: Release
assembly_info:
Expand Down Expand Up @@ -27,4 +27,3 @@ deploy:
folder: /
password:
secure: rnYQ08pwgvUSkuRhHDndvw==

0 comments on commit eccbbbb

Please sign in to comment.