mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 20:38:16 +08:00
- 优化 子查询(多表)别名;
- 优化 IUpdate.Set 支持位运算表达式树解析;
This commit is contained in:
@ -1009,8 +1009,11 @@ namespace FreeSql.Internal
|
||||
{
|
||||
if (fsqltable1SetAlias == false)
|
||||
{
|
||||
fsqltables[0].Alias = (argExp as LambdaExpression).Parameters.First().Name;
|
||||
fsqltable1SetAlias = true;
|
||||
var argExpLambda = argExp as LambdaExpression;
|
||||
var fsqlTypeGenericArgs = fsqlType.GetGenericArguments();
|
||||
for (var gai = 0; gai < fsqlTypeGenericArgs.Length && gai < argExpLambda.Parameters.Count; gai++)
|
||||
fsqltables[gai].Alias = argExpLambda.Parameters[gai].Name;
|
||||
}
|
||||
}
|
||||
args[a] = argExp ?? Expression.Lambda(arg3Exp).Compile().DynamicInvoke();
|
||||
|
@ -457,6 +457,11 @@ namespace FreeSql.Internal.CommonProvider
|
||||
{
|
||||
var body = exp?.Body;
|
||||
var nodeType = body?.NodeType;
|
||||
if (nodeType == ExpressionType.Convert)
|
||||
{
|
||||
body = (body as UnaryExpression)?.Operand;
|
||||
nodeType = body?.NodeType;
|
||||
}
|
||||
switch (nodeType)
|
||||
{
|
||||
case ExpressionType.Equal:
|
||||
@ -499,7 +504,7 @@ namespace FreeSql.Internal.CommonProvider
|
||||
if (body is BinaryExpression == false &&
|
||||
nodeType != ExpressionType.Call) return this;
|
||||
var cols = new List<SelectColumnInfo>();
|
||||
var expt = _commonExpression.ExpressionWhereLambdaNoneForeignObject(null, _table, cols, exp, null, null);
|
||||
var expt = _commonExpression.ExpressionWhereLambdaNoneForeignObject(null, _table, cols, body, null, null);
|
||||
if (cols.Any() == false) return this;
|
||||
foreach (var col in cols)
|
||||
{
|
||||
|
Reference in New Issue
Block a user