From 3071baa99257aa6c9ffcf129b83e8cd80da25a15 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Thu, 11 Apr 2024 19:15:38 +0800 Subject: [PATCH] Synchronization code --- .../Abstract/QueryableProvider/QueryableExecuteSqlAsync.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableExecuteSqlAsync.cs b/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableExecuteSqlAsync.cs index 5c3d70135..c217529eb 100644 --- a/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableExecuteSqlAsync.cs +++ b/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableExecuteSqlAsync.cs @@ -654,7 +654,7 @@ ParameterT parameter) tableName = this.QueryBuilder.JoinQueryInfos.First().TableName; } } - var current = await this.Context.Queryable().AS(tableName).Filter(null, this.QueryBuilder.IsDisabledGobalFilter).InSingleAsync(primaryKeyValue); + var current = await this.Context.Queryable().AS(tableName).WithCacheIF(this.IsCache, this.CacheTime).Filter(null, this.QueryBuilder.IsDisabledGobalFilter).InSingleAsync(primaryKeyValue); if (current != null) { result.Add(current); @@ -663,7 +663,7 @@ ParameterT parameter) while (parentId != null && await this.Context.Queryable().AS(tableName).Filter(null, this.QueryBuilder.IsDisabledGobalFilter).In(parentId).AnyAsync()) { Check.Exception(i > 100, ErrorMessage.GetThrowMessage("Dead cycle", "出现死循环或超出循环上限(100),检查最顶层的ParentId是否是null或者0")); - var parent = await this.Context.Queryable().AS(tableName).Filter(null, this.QueryBuilder.IsDisabledGobalFilter).InSingleAsync(parentId); + var parent = await this.Context.Queryable().AS(tableName).WithCacheIF(this.IsCache, this.CacheTime).Filter(null, this.QueryBuilder.IsDisabledGobalFilter).InSingleAsync(parentId); result.Add(parent); parentId = ParentInfo.PropertyInfo.GetValue(parent, null); ++i;