This commit is contained in:
sunkaixuan 2019-05-20 17:32:13 +08:00
parent d7041a8b36
commit c6aee09d60
4 changed files with 22 additions and 0 deletions

View File

@ -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 ####");
}
}

View File

@ -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() {
}
}
}

View File

@ -52,6 +52,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Demo\Demo2_Updateable.cs" />
<Compile Include="Demo\Demo3_Insertable.cs" />
<Compile Include="Demo\DemoC_GobalFilter.cs" />
<Compile Include="Demo\Demo1_Queryable.cs" />
<Compile Include="Demo\DemoD_DbFirst.cs" />

View File

@ -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);