Skip to content

Commit 5c2d90b

Browse files
author
Fraser Greenroyd
committed
Add separate build instructions for netstandard
1 parent 4a24faa commit 5c2d90b

5 files changed

Lines changed: 32 additions & 5 deletions

File tree

SQL_Adapter/AdapterActions/Execute.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
using System;
2424
using System.Collections.Generic;
25-
using System.Data.SqlClient;
2625
using BH.Engine.SQL;
2726
using BH.oM.Adapter;
2827
using BH.oM.Adapters.SQL;
@@ -34,6 +33,12 @@
3433

3534
using System.Data;
3635

36+
#if ZCTDEPLOY
37+
using Microsoft.Data.SqlClient;
38+
#else
39+
using System.Data.SqlClient;
40+
#endif
41+
3742
namespace BH.Adapter.SQL
3843
{
3944
public partial class SqlAdapter

SQL_Adapter/AdapterActions/Pull.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,15 @@
2525
using System.Linq;
2626
using BH.oM.Data.Requests;
2727
using BH.oM.Adapter;
28-
using System.Data.SqlClient;
2928
using BH.oM.Adapters.SQL;
3029
using BH.Engine.SQL;
3130

31+
#if ZCTDEPLOY
32+
using Microsoft.Data.SqlClient;
33+
#else
34+
using System.Data.SqlClient;
35+
#endif
36+
3237
namespace BH.Adapter.SQL
3338
{
3439
public partial class SqlAdapter

SQL_Adapter/AdapterActions/Push.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,17 @@
2626
using BH.oM.Base;
2727
using BH.oM.Data.Requests;
2828
using BH.oM.Adapter;
29-
using System.Data.SqlClient;
3029
using BH.oM.Adapters.SQL;
3130
using BH.Engine.SQL;
3231
using System.Data;
3332
using System.Reflection;
3433

34+
#if ZCTDEPLOY
35+
using Microsoft.Data.SqlClient;
36+
#else
37+
using System.Data.SqlClient;
38+
#endif
39+
3540
namespace BH.Adapter.SQL
3641
{
3742
public partial class SqlAdapter

SQL_Adapter/SQL_Adapter.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@
2323
</PropertyGroup>
2424

2525
<ItemGroup Condition="'$(Configuration)'=='ZeroCodeTool'">
26-
<PackageReference Include="System.Data.SqlClient" Version="4.8.5" />
2726
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
27+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.32" />
28+
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.0-preview1.23109.1" />
2829
</ItemGroup>
2930

3031
<Target Name="PostBuild" AfterTargets="PostBuildEvent">

SQL_Adapter/SqlAdapter.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,17 @@
2222

2323
using System;
2424
using System.Collections.Generic;
25-
using System.Data.SqlClient;
2625
using System.Linq;
2726
using System.Text;
2827
using System.Threading.Tasks;
2928
using BH.Engine.Base;
3029

30+
#if ZCTDEPLOY
31+
using Microsoft.Data.SqlClient;
32+
#else
33+
using System.Data.SqlClient;
34+
#endif
35+
3136
namespace BH.Adapter.SQL
3237
{
3338
public partial class SqlAdapter : BHoMAdapter
@@ -38,7 +43,13 @@ public partial class SqlAdapter : BHoMAdapter
3843

3944
public SqlAdapter(string server, string database)
4045
{
46+
bool hello = false;
47+
#if ZCTDEPLOY
48+
m_ConnectionString = $"Server = {server}; Database = {database}; Trusted_Connection = True; TrustServerCertificate=True";
49+
#else
4150
m_ConnectionString = $"Server = {server}; Database = {database}; Trusted_Connection = True;";
51+
#endif
52+
4253
Initialise();
4354
}
4455

0 commit comments

Comments
 (0)