diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/UQueryable2.cs b/Src/Asp.Net/SqlServerTest/UnitTest/UQueryable2.cs index 407d4bd9f..74e1ebdf9 100644 --- a/Src/Asp.Net/SqlServerTest/UnitTest/UQueryable2.cs +++ b/Src/Asp.Net/SqlServerTest/UnitTest/UQueryable2.cs @@ -331,6 +331,27 @@ namespace OrmTest var x2 = 0; var x3 = 0; db.Queryable().Where(it => SqlFunc.IF(true).Return(-x1).ElseIF(it.Id==1).Return(-x2).End(-x3) == 1).ToArray(); + + var test52 = db.Queryable() + .Select(m => new + { + ChildCount = SqlFunc.Subqueryable() + .Where((x) => x.Name.Substring(0, m.Name.Length + 1) == m.Name + "-") + .Count(), + }) + .ToSqlString(); + var test53 = db.Queryable() + .Select(m => new + { + ChildCount = SqlFunc.Subqueryable() + .Where((x) => x.Name.Substring(0, m.Name.Length + 1) == m.Name + "-") + .Count(), + }) + .ToList(); + if (!test52.Contains("[m].[Name]")) + { + throw new Exception("unit error"); + } } public class UnitPeople {