|
@ -116,6 +116,11 @@ namespace SqlSugar |
|
|
} |
|
|
} |
|
|
public ISugarQueryable<T, T2> LeftJoin<T2>(Expression<Func<T, T2, bool>> joinExpression) |
|
|
public ISugarQueryable<T, T2> LeftJoin<T2>(Expression<Func<T, T2, bool>> joinExpression) |
|
|
{ |
|
|
{ |
|
|
|
|
|
if (MasterHasWhereFirstJoin()) |
|
|
|
|
|
{ |
|
|
|
|
|
return this.MergeTable().LeftJoin<T2>(joinExpression); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.Context.InitMappingInfo<T2>(); |
|
|
this.Context.InitMappingInfo<T2>(); |
|
|
var result = InstanceFactory.GetQueryable<T, T2>(this.Context.CurrentConnectionConfig); |
|
|
var result = InstanceFactory.GetQueryable<T, T2>(this.Context.CurrentConnectionConfig); |
|
|
result.SqlBuilder = this.SqlBuilder; |
|
|
result.SqlBuilder = this.SqlBuilder; |
|
@ -126,6 +131,11 @@ namespace SqlSugar |
|
|
} |
|
|
} |
|
|
public ISugarQueryable<T, T2> FullJoin<T2>(Expression<Func<T, T2, bool>> joinExpression) |
|
|
public ISugarQueryable<T, T2> FullJoin<T2>(Expression<Func<T, T2, bool>> joinExpression) |
|
|
{ |
|
|
{ |
|
|
|
|
|
if (MasterHasWhereFirstJoin()) |
|
|
|
|
|
{ |
|
|
|
|
|
return this.MergeTable().FullJoin<T2>(joinExpression); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.Context.InitMappingInfo<T2>(); |
|
|
this.Context.InitMappingInfo<T2>(); |
|
|
var result = InstanceFactory.GetQueryable<T, T2>(this.Context.CurrentConnectionConfig); |
|
|
var result = InstanceFactory.GetQueryable<T, T2>(this.Context.CurrentConnectionConfig); |
|
|
result.SqlBuilder = this.SqlBuilder; |
|
|
result.SqlBuilder = this.SqlBuilder; |
|
@ -135,6 +145,12 @@ namespace SqlSugar |
|
|
} |
|
|
} |
|
|
public ISugarQueryable<T, T2> RightJoin<T2>(Expression<Func<T, T2, bool>> joinExpression) |
|
|
public ISugarQueryable<T, T2> RightJoin<T2>(Expression<Func<T, T2, bool>> joinExpression) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
if (MasterHasWhereFirstJoin()) |
|
|
|
|
|
{ |
|
|
|
|
|
return this.MergeTable().RightJoin<T2>(joinExpression); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.Context.InitMappingInfo<T2>(); |
|
|
this.Context.InitMappingInfo<T2>(); |
|
|
var result = InstanceFactory.GetQueryable<T, T2>(this.Context.CurrentConnectionConfig); |
|
|
var result = InstanceFactory.GetQueryable<T, T2>(this.Context.CurrentConnectionConfig); |
|
|
result.SqlBuilder = this.SqlBuilder; |
|
|
result.SqlBuilder = this.SqlBuilder; |
|
@ -145,6 +161,12 @@ namespace SqlSugar |
|
|
|
|
|
|
|
|
public ISugarQueryable<T, T2> InnerJoin<T2>(Expression<Func<T, T2, bool>> joinExpression) |
|
|
public ISugarQueryable<T, T2> InnerJoin<T2>(Expression<Func<T, T2, bool>> joinExpression) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
if (MasterHasWhereFirstJoin()) |
|
|
|
|
|
{ |
|
|
|
|
|
return this.MergeTable().InnerJoin<T2>(joinExpression); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.Context.InitMappingInfo<T2>(); |
|
|
this.Context.InitMappingInfo<T2>(); |
|
|
var result = InstanceFactory.GetQueryable<T, T2>(this.Context.CurrentConnectionConfig); |
|
|
var result = InstanceFactory.GetQueryable<T, T2>(this.Context.CurrentConnectionConfig); |
|
|
result.SqlBuilder = this.SqlBuilder; |
|
|
result.SqlBuilder = this.SqlBuilder; |
|
@ -152,6 +174,7 @@ namespace SqlSugar |
|
|
result.QueryBuilder.JoinQueryInfos.Add(GetJoinInfo(joinExpression, JoinType.Inner)); |
|
|
result.QueryBuilder.JoinQueryInfos.Add(GetJoinInfo(joinExpression, JoinType.Inner)); |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void Clear() |
|
|
public void Clear() |
|
|
{ |
|
|
{ |
|
|
QueryBuilder.Clear(); |
|
|
QueryBuilder.Clear(); |
|
|