mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 12:28:15 +08:00
- 优化 ISelect<T1, T2> 对象 .LeftJoin<T2> 表别名;#1348
This commit is contained in:
@ -615,18 +615,21 @@ namespace FreeSql.Internal.CommonProvider
|
||||
{
|
||||
if (exp == null) return this as TSelect;
|
||||
_tables[0].Parameter = exp.Parameters[0];
|
||||
if (_tables.Count > 1 && _tables[1].Table.Type == typeof(T2)) _tables[1].Parameter = exp.Parameters[1];
|
||||
return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
|
||||
}
|
||||
public TSelect InnerJoin<T2>(Expression<Func<T1, T2, bool>> exp)
|
||||
{
|
||||
if (exp == null) return this as TSelect;
|
||||
_tables[0].Parameter = exp.Parameters[0];
|
||||
if (_tables.Count > 1 && _tables[1].Table.Type == typeof(T2)) _tables[1].Parameter = exp.Parameters[1];
|
||||
return this.InternalJoin(exp?.Body, SelectTableInfoType.InnerJoin);
|
||||
}
|
||||
public TSelect RightJoin<T2>(Expression<Func<T1, T2, bool>> exp)
|
||||
{
|
||||
if (exp == null) return this as TSelect;
|
||||
_tables[0].Parameter = exp.Parameters[0];
|
||||
if (_tables.Count > 1 && _tables[1].Table.Type == typeof(T2)) _tables[1].Parameter = exp.Parameters[1];
|
||||
return this.InternalJoin(exp?.Body, SelectTableInfoType.RightJoin);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user