From 98d6df5db713efd7123663967d2687ca35ce7487 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sat, 24 Sep 2022 21:16:12 +0800 Subject: [PATCH] Synchronization code --- .../SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs | 4 ++++ .../SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs index 715263641..de9470d0e 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs @@ -3357,8 +3357,12 @@ namespace SqlSugar List result; var isComplexModel = QueryBuilder.IsComplexModel(sqlObj.Key); var entityType = typeof(TResult); + bool isChangeQueryableSlave = GetIsSlaveQuery(); + bool isChangeQueryableMasterSlave = GetIsMasterQuery(); var dataReader = await this.Db.GetDataReaderAsync(sqlObj.Key, sqlObj.Value.ToArray()); result =await GetDataAsync(isComplexModel, entityType, dataReader); + RestChangeMasterQuery(isChangeQueryableMasterSlave); + RestChangeSlaveQuery(isChangeQueryableSlave); return result; } diff --git a/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs b/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs index 715263641..de9470d0e 100644 --- a/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs +++ b/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs @@ -3357,8 +3357,12 @@ namespace SqlSugar List result; var isComplexModel = QueryBuilder.IsComplexModel(sqlObj.Key); var entityType = typeof(TResult); + bool isChangeQueryableSlave = GetIsSlaveQuery(); + bool isChangeQueryableMasterSlave = GetIsMasterQuery(); var dataReader = await this.Db.GetDataReaderAsync(sqlObj.Key, sqlObj.Value.ToArray()); result =await GetDataAsync(isComplexModel, entityType, dataReader); + RestChangeMasterQuery(isChangeQueryableMasterSlave); + RestChangeSlaveQuery(isChangeQueryableSlave); return result; }