- 补充 ISelect`T1...T10 LeftJoin/InnerJoin/RightJoin 多参数方法;

This commit is contained in:
28810
2019-08-06 10:32:36 +08:00
parent 4213761c62
commit 6c0bdc0e9e
19 changed files with 229 additions and 1 deletions

View File

@ -177,6 +177,27 @@ namespace FreeSql.Internal.CommonProvider
return this.InternalToSql<TReturn>(select?.Body);
}
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.LeftJoin(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
}
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.InnerJoin(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.InnerJoin);
}
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.RightJoin(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.RightJoin);
}
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>.Where(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, bool>> exp)
{
if (exp == null) return this.Where(null);

View File

@ -153,6 +153,27 @@ namespace FreeSql.Internal.CommonProvider
return this.InternalToSql<TReturn>(select?.Body);
}
ISelect<T1, T2> ISelect<T1, T2>.LeftJoin(Expression<Func<T1, T2, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
}
ISelect<T1, T2> ISelect<T1, T2>.InnerJoin(Expression<Func<T1, T2, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.InnerJoin);
}
ISelect<T1, T2> ISelect<T1, T2>.RightJoin(Expression<Func<T1, T2, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.RightJoin);
}
ISelect<T1, T2> ISelect<T1, T2>.Where(Expression<Func<T1, T2, bool>> exp)
{
if (exp == null) return this.Where(null);

View File

@ -156,6 +156,27 @@ namespace FreeSql.Internal.CommonProvider
return this.InternalToSql<TReturn>(select?.Body);
}
ISelect<T1, T2, T3> ISelect<T1, T2, T3>.LeftJoin(Expression<Func<T1, T2, T3, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
}
ISelect<T1, T2, T3> ISelect<T1, T2, T3>.InnerJoin(Expression<Func<T1, T2, T3, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.InnerJoin);
}
ISelect<T1, T2, T3> ISelect<T1, T2, T3>.RightJoin(Expression<Func<T1, T2, T3, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.RightJoin);
}
ISelect<T1, T2, T3> ISelect<T1, T2, T3>.Where(Expression<Func<T1, T2, T3, bool>> exp)
{
if (exp == null) return this.Where(null);

View File

@ -159,6 +159,27 @@ namespace FreeSql.Internal.CommonProvider
return this.InternalToSql<TReturn>(select?.Body);
}
ISelect<T1, T2, T3, T4> ISelect<T1, T2, T3, T4>.LeftJoin(Expression<Func<T1, T2, T3, T4, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
}
ISelect<T1, T2, T3, T4> ISelect<T1, T2, T3, T4>.InnerJoin(Expression<Func<T1, T2, T3, T4, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.InnerJoin);
}
ISelect<T1, T2, T3, T4> ISelect<T1, T2, T3, T4>.RightJoin(Expression<Func<T1, T2, T3, T4, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.RightJoin);
}
ISelect<T1, T2, T3, T4> ISelect<T1, T2, T3, T4>.Where(Expression<Func<T1, T2, T3, T4, bool>> exp)
{
if (exp == null) return this.Where(null);

View File

@ -162,6 +162,27 @@ namespace FreeSql.Internal.CommonProvider
return this.InternalToSql<TReturn>(select?.Body);
}
ISelect<T1, T2, T3, T4, T5> ISelect<T1, T2, T3, T4, T5>.LeftJoin(Expression<Func<T1, T2, T3, T4, T5, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
}
ISelect<T1, T2, T3, T4, T5> ISelect<T1, T2, T3, T4, T5>.InnerJoin(Expression<Func<T1, T2, T3, T4, T5, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.InnerJoin);
}
ISelect<T1, T2, T3, T4, T5> ISelect<T1, T2, T3, T4, T5>.RightJoin(Expression<Func<T1, T2, T3, T4, T5, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.RightJoin);
}
ISelect<T1, T2, T3, T4, T5> ISelect<T1, T2, T3, T4, T5>.Where(Expression<Func<T1, T2, T3, T4, T5, bool>> exp)
{
if (exp == null) return this.Where(null);

View File

@ -165,6 +165,27 @@ namespace FreeSql.Internal.CommonProvider
return this.InternalToSql<TReturn>(select?.Body);
}
ISelect<T1, T2, T3, T4, T5, T6> ISelect<T1, T2, T3, T4, T5, T6>.LeftJoin(Expression<Func<T1, T2, T3, T4, T5, T6, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
}
ISelect<T1, T2, T3, T4, T5, T6> ISelect<T1, T2, T3, T4, T5, T6>.InnerJoin(Expression<Func<T1, T2, T3, T4, T5, T6, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.InnerJoin);
}
ISelect<T1, T2, T3, T4, T5, T6> ISelect<T1, T2, T3, T4, T5, T6>.RightJoin(Expression<Func<T1, T2, T3, T4, T5, T6, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.RightJoin);
}
ISelect<T1, T2, T3, T4, T5, T6> ISelect<T1, T2, T3, T4, T5, T6>.Where(Expression<Func<T1, T2, T3, T4, T5, T6, bool>> exp)
{
if (exp == null) return this.Where(null);

View File

@ -168,6 +168,27 @@ namespace FreeSql.Internal.CommonProvider
return this.InternalToSql<TReturn>(select?.Body);
}
ISelect<T1, T2, T3, T4, T5, T6, T7> ISelect<T1, T2, T3, T4, T5, T6, T7>.LeftJoin(Expression<Func<T1, T2, T3, T4, T5, T6, T7, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
}
ISelect<T1, T2, T3, T4, T5, T6, T7> ISelect<T1, T2, T3, T4, T5, T6, T7>.InnerJoin(Expression<Func<T1, T2, T3, T4, T5, T6, T7, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.InnerJoin);
}
ISelect<T1, T2, T3, T4, T5, T6, T7> ISelect<T1, T2, T3, T4, T5, T6, T7>.RightJoin(Expression<Func<T1, T2, T3, T4, T5, T6, T7, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.RightJoin);
}
ISelect<T1, T2, T3, T4, T5, T6, T7> ISelect<T1, T2, T3, T4, T5, T6, T7>.Where(Expression<Func<T1, T2, T3, T4, T5, T6, T7, bool>> exp)
{
if (exp == null) return this.Where(null);

View File

@ -171,6 +171,27 @@ namespace FreeSql.Internal.CommonProvider
return this.InternalToSql<TReturn>(select?.Body);
}
ISelect<T1, T2, T3, T4, T5, T6, T7, T8> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.LeftJoin(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
}
ISelect<T1, T2, T3, T4, T5, T6, T7, T8> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.InnerJoin(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.InnerJoin);
}
ISelect<T1, T2, T3, T4, T5, T6, T7, T8> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.RightJoin(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.RightJoin);
}
ISelect<T1, T2, T3, T4, T5, T6, T7, T8> ISelect<T1, T2, T3, T4, T5, T6, T7, T8>.Where(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, bool>> exp)
{
if (exp == null) return this.Where(null);

View File

@ -174,6 +174,27 @@ namespace FreeSql.Internal.CommonProvider
return this.InternalToSql<TReturn>(select?.Body);
}
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.LeftJoin(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
}
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.InnerJoin(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.InnerJoin);
}
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.RightJoin(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.RightJoin);
}
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.Where(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, bool>> exp)
{
if (exp == null) return this.Where(null);