From c6aee09d602b3dc25f87d69dcf76647c79f40f9e Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Mon, 20 May 2019 17:32:13 +0800 Subject: [PATCH] - --- .../SqlServerTest/Demo/Demo2_Updateable.cs | 5 +++++ .../SqlServerTest/Demo/Demo3_Insertable.cs | 15 +++++++++++++++ Src/Asp.Net/SqlServerTest/SqlServerTest.csproj | 1 + .../QueryableProvider/QueryableProvider.cs | 1 + 4 files changed, 22 insertions(+) create mode 100644 Src/Asp.Net/SqlServerTest/Demo/Demo3_Insertable.cs diff --git a/Src/Asp.Net/SqlServerTest/Demo/Demo2_Updateable.cs b/Src/Asp.Net/SqlServerTest/Demo/Demo2_Updateable.cs index 802a5ed44..7fb4431e4 100644 --- a/Src/Asp.Net/SqlServerTest/Demo/Demo2_Updateable.cs +++ b/Src/Asp.Net/SqlServerTest/Demo/Demo2_Updateable.cs @@ -11,6 +11,9 @@ namespace OrmTest { public static void Init() { + Console.WriteLine(""); + Console.WriteLine("#### Updateable Start ####"); + SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() { DbType = DbType.SqlServer, @@ -96,6 +99,8 @@ namespace OrmTest //Where Sql db.Updateable(updateObj).Where("id=@x", new { x = "1" }).ExecuteCommand(); + + Console.WriteLine("#### Updateable End ####"); } } diff --git a/Src/Asp.Net/SqlServerTest/Demo/Demo3_Insertable.cs b/Src/Asp.Net/SqlServerTest/Demo/Demo3_Insertable.cs new file mode 100644 index 000000000..c345ff063 --- /dev/null +++ b/Src/Asp.Net/SqlServerTest/Demo/Demo3_Insertable.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OrmTest +{ + public class Demo3_Insertable + { + public static void Init() { + + } + } +} diff --git a/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj b/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj index 830f463ac..4b42e70ef 100644 --- a/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj +++ b/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj @@ -52,6 +52,7 @@ + diff --git a/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs index 2c6d5ae0a..bba230aa8 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs @@ -1845,6 +1845,7 @@ namespace SqlSugar { var contextProperty = item.GetType().GetProperty("Context"); SqlSugarProvider newClient = this.Context.Utilities.CopyContext(); + newClient.Ado.IsDisableMasterSlaveSeparation = true; if (newClient.CurrentConnectionConfig.AopEvents == null) newClient.CurrentConnectionConfig.AopEvents = new AopEvents(); contextProperty.SetValue(item, newClient, null);