mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-06-28 04:35:29 +08:00
Update ExpressionTool
This commit is contained in:
parent
9c1bde2e88
commit
1c8a8c1460
@ -9,6 +9,21 @@ namespace SqlSugar
|
||||
{
|
||||
public class ExpressionTool
|
||||
{
|
||||
public static Dictionary<string, Expression> GetNewExpressionItemList(Expression lamExp)
|
||||
{
|
||||
var exp=GetLambdaExpressionBody(lamExp)as NewExpression;
|
||||
var dict = new Dictionary<string, Expression>();
|
||||
|
||||
for (int i = 0; i < exp.Arguments.Count; i++)
|
||||
{
|
||||
var arg = exp.Arguments[i];
|
||||
var parameterInfo = exp.Constructor.GetParameters()[i];
|
||||
|
||||
dict.Add(parameterInfo.Name, arg);
|
||||
}
|
||||
|
||||
return dict;
|
||||
}
|
||||
public static Dictionary<string, Expression> GetMemberBindingItemList(ReadOnlyCollection<MemberBinding> exp)
|
||||
{
|
||||
Dictionary<string, Expression> dict = new Dictionary<string, Expression>();
|
||||
|
Loading…
Reference in New Issue
Block a user