From f4c035087303f62bad89be47e570aec12b208651 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sat, 1 Oct 2022 10:04:29 +0800 Subject: [PATCH] Add unit test --- Src/Asp.Net/SqlServerTest/UnitTest/UCustom20.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/UCustom20.cs b/Src/Asp.Net/SqlServerTest/UnitTest/UCustom20.cs index c7c46d112..b80db1b10 100644 --- a/Src/Asp.Net/SqlServerTest/UnitTest/UCustom20.cs +++ b/Src/Asp.Net/SqlServerTest/UnitTest/UCustom20.cs @@ -107,6 +107,20 @@ namespace OrmTest { throw new Exception("unit error"); } + + var test8 = db.Queryable() + .LeftJoin((x, y) => x.Id == y.Id) + .Take(2) + .Select((x, y) => new TestDTO + { + SubOne = new TestSubDTO { NameOne = "a", NameTwo =x.Name } + }) + .ToList(); + + if (test8.First().SubOne.NameOne != "a" || test8.First().SubOne.NameTwo != "jack") + { + throw new Exception("unit error"); + } } public class TestDTO