Skip to content

Commit

Permalink
- 增加 ISelect.Join 与 InnerJoin 方式行为一致;
Browse files Browse the repository at this point in the history
  • Loading branch information
2881099 committed Dec 18, 2024
1 parent c6f1432 commit e094160
Show file tree
Hide file tree
Showing 6 changed files with 484 additions and 477 deletions.
8 changes: 0 additions & 8 deletions FreeSql/FreeSql.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
</ItemGroup>

<ItemGroup>
<Compile Update="Internal\CommonProvider\SelectProvider\Select1Provider2`16.cs">
<DependentUpon>Select1Provider2`16.tt</DependentUpon>
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
</Compile>
</ItemGroup>

<ItemGroup>
<None Update="Internal\CommonProvider\SelectProvider\T4Temp\ISelect2`16.tt">
<Generator>TextTemplatingFileGenerator</Generator>
Expand Down
870 changes: 416 additions & 454 deletions FreeSql/FreeSql.xml

Large diffs are not rendered by default.

43 changes: 32 additions & 11 deletions FreeSql/Interface/Curd/ISelect/ISelect2`16.cs

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public interface ISelect<<#=NewStr #>> : ISelect0<ISelect<<#=NewStr #>>, T1> <#=
double Avg<TMember>(Expression<Func<<#=NewStr #>, TMember>> column);

ISelect<<#=NewStr #>> LeftJoin(Expression<Func<<#=NewStr #>, bool>> exp);
ISelect<<#=NewStr #>> Join(Expression<Func<<#=NewStr #>, bool>> exp);
ISelect<<#=NewStr #>> InnerJoin(Expression<Func<<#=NewStr #>, bool>> exp);
ISelect<<#=NewStr #>> RightJoin(Expression<Func<<#=NewStr #>, bool>> exp);

Expand Down Expand Up @@ -141,6 +142,7 @@ public interface ISelect<<#=NewStr #>> : ISelect0<ISelect<<#=NewStr #>>, T1> <#=
double Avg<TMember>(Expression<Func<HzyTuple<<#=NewStr #>>, TMember>> column);

ISelect<<#=NewStr #>> LeftJoin(Expression<Func<HzyTuple<<#=NewStr #>>, bool>> exp);
ISelect<<#=NewStr #>> Join(Expression<Func<HzyTuple<<#=NewStr #>>, bool>> exp);
ISelect<<#=NewStr #>> InnerJoin(Expression<Func<HzyTuple<<#=NewStr #>>, bool>> exp);
ISelect<<#=NewStr #>> RightJoin(Expression<Func<HzyTuple<<#=NewStr #>>, bool>> exp);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ namespace FreeSql.Internal.CommonProvider
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
}


ISelect<<#=NewStr #>> ISelect<<#=NewStr #>>.Join(Expression<Func<<#=NewStr #>, bool>> exp) => (this as ISelect<<#=NewStr #>>).InnerJoin(exp);
ISelect<<#=NewStr #>> ISelect<<#=NewStr #>>.InnerJoin(Expression<Func<<#=NewStr #>, bool>> exp)
{
if (exp == null) return this.InternalJoin(exp?.Body, SelectTableInfoType.LeftJoin);
Expand Down Expand Up @@ -352,7 +353,8 @@ namespace FreeSql.Internal.CommonProvider
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
return (this as ISelect<<#=NewStr #>>).LeftJoin((Expression<Func<<#=NewStr #>, bool>>)expModify);
}


ISelect<<#=NewStr #>> ISelect<<#=NewStr #>>.Join(Expression<Func<HzyTuple<<#=NewStr #>>, bool>> exp) => (this as ISelect<<#=NewStr #>>).InnerJoin(exp);
ISelect<<#=NewStr #>> ISelect<<#=NewStr #>>.InnerJoin(Expression<Func<HzyTuple<<#=NewStr #>>, bool>> exp)
{
var expModify = new CommonExpression.ReplaceHzyTupleToMultiParam().Modify(exp, _tables);
Expand Down

0 comments on commit e094160

Please sign in to comment.