Merge branch 'master' of github.com:dotnetcore/FreeSql

This commit is contained in:
igeekfan
2022-06-10 03:06:03 +08:00
30 changed files with 219 additions and 210 deletions

View File

@ -70,7 +70,7 @@ public static class FreeSqlExtensionsLinqSql
internal static void InternalJoin2<T1>(Select1Provider<T1> s1p, LambdaExpression outerKeySelector, LambdaExpression innerKeySelector, LambdaExpression resultSelector) where T1 : class
{
s1p._tables[0].Parameter = resultSelector.Parameters[0];
s1p._commonExpression.ExpressionLambdaToSql(outerKeySelector, new CommonExpression.ExpTSC { _tables = s1p._tables });
s1p._commonExpression.ExpressionLambdaToSql(outerKeySelector, new CommonExpression.ExpTSC { _tables = s1p._tables, _tableRule = s1p._tableRule });
s1p.InternalJoin(Expression.Lambda(typeof(Func<,,>).MakeGenericType(typeof(T1), innerKeySelector.Parameters[0].Type, typeof(bool)),
Expression.Equal(outerKeySelector.Body, innerKeySelector.Body),
new[] { outerKeySelector.Parameters[0], innerKeySelector.Parameters[0] }

View File

@ -67,7 +67,7 @@ namespace FreeSql.Internal.CommonProvider
var index = -10000; //临时规则,不返回 as1
if (selector != null)
_comonExp.ReadAnonymousField(_select._tables, field, _map, ref index, selector, null, null, _select._whereGlobalFilter, null, null, false); //不走 DTO 映射,不处理 IncludeMany
_comonExp.ReadAnonymousField(_select._tables, _select._tableRule, field, _map, ref index, selector, null, null, _select._whereGlobalFilter, null, null, false); //不走 DTO 映射,不处理 IncludeMany
_field = field.ToString();
}
@ -162,7 +162,7 @@ namespace FreeSql.Internal.CommonProvider
{
if (condition == false) return this;
_lambdaParameter = column?.Parameters[0];
var sql = _comonExp.ExpressionWhereLambda(null, column, this, null, null);
var sql = _comonExp.ExpressionWhereLambda(null, null, column, this, null, null);
var method = _select.GetType().GetMethod("OrderBy", new[] { typeof(string), typeof(object) });
method.Invoke(_select, new object[] { descending ? $"{sql} DESC" : sql, null });
return this;
@ -174,7 +174,7 @@ namespace FreeSql.Internal.CommonProvider
{
if (condition == false) return this;
_lambdaParameter = exp?.Parameters[0];
var sql = _comonExp.ExpressionWhereLambda(null, exp, this, null, null);
var sql = _comonExp.ExpressionWhereLambda(null, null, exp, this, null, null);
var method = _select.GetType().GetMethod("Where", new[] { typeof(string), typeof(object) });
method.Invoke(_select, new object[] { sql, null });
return this;