mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 18:22:23 +08:00
-
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -156,5 +156,16 @@ namespace SqlSugar
|
||||
}
|
||||
return reval;
|
||||
}
|
||||
|
||||
public static object DynamicInvoke(MemberExpression expression)
|
||||
{
|
||||
object value = Expression.Lambda(expression).Compile().DynamicInvoke();
|
||||
if (value != null && value.GetType().IsClass && value.GetType() != ExpressionConst.StringType)
|
||||
{
|
||||
value = Expression.Lambda(expression).Compile().DynamicInvoke();
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -14,16 +14,7 @@ namespace SqlSugar
|
||||
var isLeft = parameter.IsLeft;
|
||||
var isWhereSingle = parameter.Context.IsWhereSingle;
|
||||
object value = null;
|
||||
var isField = expression.Member is System.Reflection.FieldInfo;
|
||||
var isProperty = expression.Member is System.Reflection.PropertyInfo;
|
||||
if (isField)
|
||||
{
|
||||
value = ExpressionTool.GetFiledValue(expression);
|
||||
}
|
||||
else if (isProperty)
|
||||
{
|
||||
value = ExpressionTool.GetPropertyValue(expression.Expression as MemberExpression);
|
||||
}
|
||||
value = ExpressionTool.DynamicInvoke(expression);
|
||||
if (parameter.BaseParameter.BinaryExpressionInfoList != null)
|
||||
{
|
||||
parameter.BaseParameter.BinaryExpressionInfoList.Add(new KeyValuePair<string, BinaryExpressionInfo>(ExpressionConst.BinaryExpressionInfoListKey, new BinaryExpressionInfo()
|
||||
@@ -33,11 +24,6 @@ namespace SqlSugar
|
||||
ExpressionType = ExpressionConst.ConstantExpressionType
|
||||
}));
|
||||
}
|
||||
if (isLeft == null && base.Context.SqlWhere == null)
|
||||
{
|
||||
base.Context.SqlWhere = new StringBuilder();
|
||||
base.Context.SqlWhere.Append(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
@@ -3,3 +3,4 @@ F:\MyOpenSource\SqlSugar4.XNew\SqlSugar\SqlSugar\bin\Debug\SqlSugar.pdb
|
||||
F:\MyOpenSource\SqlSugar4.XNew\SqlSugar\SqlSugar\bin\Debug\Newtonsoft.Json.dll
|
||||
F:\MyOpenSource\SqlSugar4.XNew\SqlSugar\SqlSugar\obj\Debug\SqlSugar.dll
|
||||
F:\MyOpenSource\SqlSugar4.XNew\SqlSugar\SqlSugar\obj\Debug\SqlSugar.pdb
|
||||
F:\MyOpenSource\SqlSugar4.XNew\SqlSugar\SqlSugar\obj\Debug\SqlSugar.csprojResolveAssemblyReference.cache
|
||||
|
BIN
SqlSugar/obj/Debug/SqlSugar.csprojResolveAssemblyReference.cache
Normal file
BIN
SqlSugar/obj/Debug/SqlSugar.csprojResolveAssemblyReference.cache
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user