mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 18:52:50 +08:00
调用 WhereDynamicFilter 前增加 As 方法调用
This commit is contained in:
parent
4fe40d0be0
commit
b31ee808f6
@ -358,6 +358,9 @@ namespace FreeSql.Tests.Issues
|
|||||||
|
|
||||||
var selectMethod = typeof(FreeSqlGlobalExtensions).GetMethods().First(a => a.Name == "AsSelect" && a.ContainsGenericParameters && a.GetParameters().Count() == 1).MakeGenericMethod(sub.TableRef.RefEntityType);
|
var selectMethod = typeof(FreeSqlGlobalExtensions).GetMethods().First(a => a.Name == "AsSelect" && a.ContainsGenericParameters && a.GetParameters().Count() == 1).MakeGenericMethod(sub.TableRef.RefEntityType);
|
||||||
body = Expression.Call(null, selectMethod, body);
|
body = Expression.Call(null, selectMethod, body);
|
||||||
|
var asMethod = typeof(ISelect<>).MakeGenericType(sub.TableRef.RefEntityType).GetMethod("As");
|
||||||
|
var constExpression = Expression.Constant($"t{deepest.Level}");
|
||||||
|
body = Expression.Call(body, asMethod, constExpression);
|
||||||
var whereDynamicFilterMethod = typeof(ISelect0<,>).MakeGenericType(typeof(ISelect<>).MakeGenericType(sub.TableRef.RefEntityType), sub.TableRef.RefEntityType).GetMethod("WhereDynamicFilter");
|
var whereDynamicFilterMethod = typeof(ISelect0<,>).MakeGenericType(typeof(ISelect<>).MakeGenericType(sub.TableRef.RefEntityType), sub.TableRef.RefEntityType).GetMethod("WhereDynamicFilter");
|
||||||
body = Expression.Call(body, whereDynamicFilterMethod, Expression.Constant(filterInfo));
|
body = Expression.Call(body, whereDynamicFilterMethod, Expression.Constant(filterInfo));
|
||||||
var anyMethod = typeof(ISelect0<,>).MakeGenericType(typeof(ISelect<>).MakeGenericType(sub.TableRef.RefEntityType), sub.TableRef.RefEntityType).GetMethod("Any");
|
var anyMethod = typeof(ISelect0<,>).MakeGenericType(typeof(ISelect<>).MakeGenericType(sub.TableRef.RefEntityType), sub.TableRef.RefEntityType).GetMethod("Any");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user