Add UpdateJoin TableName

This commit is contained in:
sunkaixuan
2023-10-20 11:55:40 +08:00
parent 1a91c8b6b5
commit 2195f9cd0d
2 changed files with 11 additions and 0 deletions

View File

@@ -204,6 +204,16 @@ namespace SqlSugar
result.updateableObj.UpdateBuilder.ShortName = joinExpress.Parameters.FirstOrDefault()?.Name;
return result;
}
public IUpdateable<T, T2> InnerJoin<T2>(Expression<Func<T, T2, bool>> joinExpress,string TableName)
{
UpdateableProvider<T, T2> result = new UpdateableProvider<T, T2>();
result.updateableObj = this;
var querybale = this.Context.Queryable<T>().LeftJoin<T2>(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<T> Clone()
{
this.Context.SugarActionType = SugarActionType.Update;

View File

@@ -118,6 +118,7 @@ namespace SqlSugar
IUpdateable<T> EnableQueryFilter();
IUpdateable<T> Clone();
IUpdateable<T,T2> InnerJoin<T2>(Expression<Func<T,T2,bool>> joinExpress);
IUpdateable<T, T2> InnerJoin<T2>(Expression<Func<T, T2, bool>> joinExpress,string tableName);
UpdateablePage<T> PageSize(int pageSize);
IUpdateable<T> In(object[] ids);
}