From 9ae5e0d2df851c5ff00164113843c1d7c9a78f75 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Tue, 27 Dec 2022 19:19:02 +0800 Subject: [PATCH] Update Subquery.ToList --- .../SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs b/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs index 3c78d3186..9b93856f2 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/QueryBuilder.cs @@ -692,6 +692,10 @@ namespace SqlSugar { return result.Replace("/**/*", ""); } + if (this.IsSingle() && this.SubToListParameters != null&& expression is LambdaExpression && this.SubToListParameters.Count > 0 && this.TableShortName == null) + { + this.TableShortName =this.Builder.GetTranslationColumnName((expression as LambdaExpression).Parameters[0].Name); + } if (result.Contains(".*") && this.IsSingle()) { return "*";