From 2195f9cd0d997de8c5cceb8105acf7ada00cb549 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Fri, 20 Oct 2023 11:55:40 +0800 Subject: [PATCH] Add UpdateJoin TableName --- .../Abstract/UpdateProvider/UpdateableProvider.cs | 10 ++++++++++ Src/Asp.NetCore2/SqlSugar/Interface/IUpdateable.cs | 1 + 2 files changed, 11 insertions(+) diff --git a/Src/Asp.NetCore2/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs b/Src/Asp.NetCore2/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs index 51d9283dc..0f9fc7293 100644 --- a/Src/Asp.NetCore2/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs +++ b/Src/Asp.NetCore2/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs @@ -204,6 +204,16 @@ namespace SqlSugar result.updateableObj.UpdateBuilder.ShortName = joinExpress.Parameters.FirstOrDefault()?.Name; return result; } + public IUpdateable InnerJoin(Expression> joinExpress,string TableName) + { + UpdateableProvider result = new UpdateableProvider(); + result.updateableObj = this; + var querybale = this.Context.Queryable().LeftJoin(joinExpress); + result.updateableObj.UpdateBuilder.JoinInfos = querybale.QueryBuilder.JoinQueryInfos; + result.updateableObj.UpdateBuilder.ShortName = joinExpress.Parameters.FirstOrDefault()?.Name; + result.updateableObj.UpdateBuilder.TableName = TableName; + return result; + } public IUpdateable Clone() { this.Context.SugarActionType = SugarActionType.Update; diff --git a/Src/Asp.NetCore2/SqlSugar/Interface/IUpdateable.cs b/Src/Asp.NetCore2/SqlSugar/Interface/IUpdateable.cs index 47489c8cb..566ebd29e 100644 --- a/Src/Asp.NetCore2/SqlSugar/Interface/IUpdateable.cs +++ b/Src/Asp.NetCore2/SqlSugar/Interface/IUpdateable.cs @@ -118,6 +118,7 @@ namespace SqlSugar IUpdateable EnableQueryFilter(); IUpdateable Clone(); IUpdateable InnerJoin(Expression> joinExpress); + IUpdateable InnerJoin(Expression> joinExpress,string tableName); UpdateablePage PageSize(int pageSize); IUpdateable In(object[] ids); }