From 2eb91382ed7249d0f80536cf95f804de8a71e82b Mon Sep 17 00:00:00 2001 From: sunkaixuna <610262374@qq.com> Date: Fri, 24 Dec 2021 21:24:24 +0800 Subject: [PATCH] Update exp to sql --- .../SqlSugar/ExpressionsToSql/Subquery/Items/SubInnerJoin.cs | 2 +- .../SqlSugar/ExpressionsToSql/Subquery/Items/SubLeftJoin.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/Asp.Net/SqlSugar/ExpressionsToSql/Subquery/Items/SubInnerJoin.cs b/Src/Asp.Net/SqlSugar/ExpressionsToSql/Subquery/Items/SubInnerJoin.cs index d78cc4d04..daaf819c4 100644 --- a/Src/Asp.Net/SqlSugar/ExpressionsToSql/Subquery/Items/SubInnerJoin.cs +++ b/Src/Asp.Net/SqlSugar/ExpressionsToSql/Subquery/Items/SubInnerJoin.cs @@ -44,7 +44,7 @@ namespace SqlSugar var exp = expression as MethodCallExpression; var argExp = exp.Arguments[0]; var name =this.Context.GetTranslationColumnName((argExp as LambdaExpression).Parameters[0].Name); - var parameter = (argExp as LambdaExpression).Parameters[1]; + var parameter = (argExp as LambdaExpression).Parameters.Last(); Context.InitMappingInfo(parameter.Type); var tableName= Context.GetTranslationTableName(parameter.Type.Name, true); var joinString =string.Format(" {2} INNER JOIN {1} {0} ", diff --git a/Src/Asp.Net/SqlSugar/ExpressionsToSql/Subquery/Items/SubLeftJoin.cs b/Src/Asp.Net/SqlSugar/ExpressionsToSql/Subquery/Items/SubLeftJoin.cs index f46e25194..4302d2c36 100644 --- a/Src/Asp.Net/SqlSugar/ExpressionsToSql/Subquery/Items/SubLeftJoin.cs +++ b/Src/Asp.Net/SqlSugar/ExpressionsToSql/Subquery/Items/SubLeftJoin.cs @@ -44,7 +44,7 @@ namespace SqlSugar var exp = expression as MethodCallExpression; var argExp = exp.Arguments[0]; var name =this.Context.GetTranslationColumnName((argExp as LambdaExpression).Parameters[0].Name); - var parameter = (argExp as LambdaExpression).Parameters[1]; + var parameter = (argExp as LambdaExpression).Parameters.Last(); Context.InitMappingInfo(parameter.Type); var tableName= Context.GetTranslationTableName(parameter.Type.Name, true); var joinString =string.Format(" {2} LEFT JOIN {1} {0} ",