From b31ee808f6cf07ad9628b8e59719ddf6f319205d Mon Sep 17 00:00:00 2001 From: hd2y Date: Mon, 30 May 2022 06:59:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E7=94=A8=20WhereDynamicFilter=20?= =?UTF-8?q?=E5=89=8D=E5=A2=9E=E5=8A=A0=20As=20=E6=96=B9=E6=B3=95=E8=B0=83?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FreeSql.Tests/FreeSql.Tests/Issues/1113.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/FreeSql.Tests/FreeSql.Tests/Issues/1113.cs b/FreeSql.Tests/FreeSql.Tests/Issues/1113.cs index 50902789..5ed79e34 100644 --- a/FreeSql.Tests/FreeSql.Tests/Issues/1113.cs +++ b/FreeSql.Tests/FreeSql.Tests/Issues/1113.cs @@ -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); 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"); body = Expression.Call(body, whereDynamicFilterMethod, Expression.Constant(filterInfo)); var anyMethod = typeof(ISelect0<,>).MakeGenericType(typeof(ISelect<>).MakeGenericType(sub.TableRef.RefEntityType), sub.TableRef.RefEntityType).GetMethod("Any");