- 优化 支持动态操作 .IncludeByPropertyName 之后的 then.WhereDynamicFilter 操作;

This commit is contained in:
2881099
2023-02-24 21:33:27 +08:00
parent 699ddfe9c1
commit 679cf7efca
15 changed files with 684 additions and 3 deletions

View File

@ -561,6 +561,14 @@ namespace FreeSql.Internal.CommonProvider
{
var methodParameterTypes = node.Method.GetParameters().Select(a => a.ParameterType).ToArray();
var method = _replaceExp.Type.GetMethod(node.Method.Name, methodParameterTypes);
if (method == null && _replaceExp.Type.IsInterface)
{
foreach (var baseInterface in _replaceExp.Type.GetInterfaces())
{
method = baseInterface.GetMethod(node.Method.Name, methodParameterTypes);
if (method != null) break;
}
}
if (node.Object?.NodeType == ExpressionType.Parameter && node.Object == oldParameter)
return Expression.Call(_replaceExp, method, node.Arguments);
return Expression.Call(Visit(node.Object), method, node.Arguments);