From 65091b21c782627e3c876ea1f0bc6d523cf536bc Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Tue, 22 Nov 2022 11:00:52 +0800 Subject: [PATCH] Update exp to sql --- .../SqlSugar/ExpressionsToSql/Subquery/Items/SubWhere.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Subquery/Items/SubWhere.cs b/Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Subquery/Items/SubWhere.cs index 2fb7a847d..35d404c7e 100644 --- a/Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Subquery/Items/SubWhere.cs +++ b/Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Subquery/Items/SubWhere.cs @@ -45,7 +45,13 @@ namespace SqlSugar new SubSelect() { Context = this.Context }.SetShortName(exp, "+"); } var argExp = exp.Arguments[0]; - var result = "WHERE " + SubTools.GetMethodValue(Context, argExp, ResolveExpressType.WhereMultiple); + var copyContext = this.Context; + if (this.Context.JoinIndex > 0) + { + copyContext = this.Context.GetCopyContextWithMapping(); + copyContext.IsSingle = false; + } + var result = "WHERE " + SubTools.GetMethodValue(copyContext, argExp, ResolveExpressType.WhereMultiple);