mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-15 18:55:07 +08:00
-
This commit is contained in:
@@ -25,16 +25,24 @@ namespace SqlSugar
|
||||
}
|
||||
public ISubInsertable<T> AddSubList(Expression<Func<T, SubInsertTree>> tree)
|
||||
{
|
||||
var lamda = (tree as LambdaExpression);
|
||||
var memInit = lamda.Body as MemberInitExpression;
|
||||
if (memInit.Bindings != null)
|
||||
try
|
||||
{
|
||||
|
||||
MemberAssignment memberAssignment = (MemberAssignment)memInit.Bindings[0];
|
||||
SubList.Add(new SubInsertTreeExpression() {
|
||||
Expression= memberAssignment.Expression,
|
||||
Childs= GetSubInsertTree(((MemberAssignment)memInit.Bindings[1]).Expression)
|
||||
});
|
||||
var lamda = (tree as LambdaExpression);
|
||||
var memInit = lamda.Body as MemberInitExpression;
|
||||
if (memInit.Bindings != null)
|
||||
{
|
||||
|
||||
MemberAssignment memberAssignment = (MemberAssignment)memInit.Bindings[0];
|
||||
SubList.Add(new SubInsertTreeExpression()
|
||||
{
|
||||
Expression = memberAssignment.Expression,
|
||||
Childs = GetSubInsertTree(((MemberAssignment)memInit.Bindings[1]).Expression)
|
||||
});
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Check.Exception(true, tree.ToString() + " format error ");
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
Reference in New Issue
Block a user