Browse Source

Synchronization code

SqlSugar5
sunkaixuan 2 years ago
parent
commit
a69b8c0026
  1. 2
      Src/Asp.Net/SqlSugar/Abstract/SugarProvider/SqlSugarScopeProvider.cs
  2. 17
      Src/Asp.Net/SqlSugar/Json2Sql/Provider/Common/JsonCommonProvider.cs

2
Src/Asp.Net/SqlSugar/Abstract/SugarProvider/SqlSugarScopeProvider.cs

@ -12,7 +12,7 @@ namespace SqlSugar
{ {
public class SqlSugarScopeProvider:ISqlSugarClient public class SqlSugarScopeProvider:ISqlSugarClient
{ {
private SqlSugarProvider conn; internal SqlSugarProvider conn;
public SqlSugarScopeProvider(SqlSugarProvider conn) public SqlSugarScopeProvider(SqlSugarProvider conn)
{ {

17
Src/Asp.Net/SqlSugar/Json2Sql/Provider/Common/JsonCommonProvider.cs

@ -11,7 +11,22 @@ namespace SqlSugar
{ {
//this.context = context; //this.context = context;
this.sqlBuilder = InstanceFactory.GetSqlbuilder(context.CurrentConnectionConfig); this.sqlBuilder = InstanceFactory.GetSqlbuilder(context.CurrentConnectionConfig);
this.sqlBuilder.Context = (context as SqlSugarClient).Context; if (context is SqlSugarProvider)
{
this.sqlBuilder.Context = context as SqlSugarProvider;
}
else if (context is SqlSugarScopeProvider)
{
this.sqlBuilder.Context = (context as SqlSugarScopeProvider).conn;
}
else if(context is SqlSugarScope)
{
this.sqlBuilder.Context = (context as SqlSugarScope).GetConnection(context.CurrentConnectionConfig.ConfigId);
}
else
{
this.sqlBuilder.Context = (context as SqlSugarClient).Context;
}
} }
//public ISqlSugarClient context { get; set; } //public ISqlSugarClient context { get; set; }
public ISqlBuilder sqlBuilder { get; set; } public ISqlBuilder sqlBuilder { get; set; }

Loading…
Cancel
Save