mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 12:28:15 +08:00
Include 贪婪加载第一版,已通过集合的导航数据加载,包括 OneToMany/ManyToMany
This commit is contained in:
@ -602,15 +602,28 @@ namespace FreeSql.Extensions.EntityUtil {
|
||||
});
|
||||
if (_table.Properties.ContainsKey(pn)) {
|
||||
var prop = _table.Properties[pn];
|
||||
exps.Add(
|
||||
Expression.Assign(
|
||||
Expression.MakeMemberAccess(var1Parm, prop),
|
||||
Expression.Convert(
|
||||
FreeSql.Internal.Utils.GetDataReaderValueBlockExpression(prop.PropertyType, parm3),
|
||||
prop.PropertyType
|
||||
|
||||
if (_table.ColumnsByCs.ContainsKey(pn)) {
|
||||
exps.Add(
|
||||
Expression.Assign(
|
||||
Expression.MakeMemberAccess(var1Parm, prop),
|
||||
Expression.Convert(
|
||||
FreeSql.Internal.Utils.GetDataReaderValueBlockExpression(prop.PropertyType, parm3),
|
||||
prop.PropertyType
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
);
|
||||
} else {
|
||||
exps.Add(
|
||||
Expression.Assign(
|
||||
Expression.MakeMemberAccess(var1Parm, prop),
|
||||
Expression.Convert(
|
||||
parm3,
|
||||
prop.PropertyType
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
return Expression.Lambda<Action<object, string, object>>(Expression.Block(new[] { var1Parm }, exps), new[] { parm1, parm2, parm3 }).Compile();
|
||||
});
|
||||
|
Reference in New Issue
Block a user