Browse Source

-

pull/12/MERGE
sunkaixuan 6 years ago
parent
commit
c6aee09d60
  1. 5
      Src/Asp.Net/SqlServerTest/Demo/Demo2_Updateable.cs
  2. 15
      Src/Asp.Net/SqlServerTest/Demo/Demo3_Insertable.cs
  3. 1
      Src/Asp.Net/SqlServerTest/SqlServerTest.csproj
  4. 1
      Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs

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

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

1
Src/Asp.Net/SqlServerTest/SqlServerTest.csproj

@ -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" />

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

Loading…
Cancel
Save