From 20741778d2c017b3e5f0084d9eff00edfc8ca799 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Wed, 3 Aug 2022 00:45:37 +0800 Subject: [PATCH] Add unit test --- .../SqlServerTest/UnitTest/UnitSelectN.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/UnitSelectN.cs b/Src/Asp.Net/SqlServerTest/UnitTest/UnitSelectN.cs index 4b96e88ab..36a046232 100644 --- a/Src/Asp.Net/SqlServerTest/UnitTest/UnitSelectN.cs +++ b/Src/Asp.Net/SqlServerTest/UnitTest/UnitSelectN.cs @@ -43,7 +43,22 @@ namespace OrmTest { throw new Exception("unit error"); } - + var data3 = db.Queryable() + .LeftJoin((b, a) => b.AId == a.AId) + .LeftJoin((b, a, aa) => a.AId == aa.AId) + .LeftJoin((b, a, aa, bb) => bb.BId == b.BId) + .Select((b, a, aa, bb) => new + { + b=b.BId, + A=new ADTO() { AId=a.AId }, + B = new BDTO{ BId = b.BId, BName = b.BName, AId = a.AId } + }) + .ToList(); + if (data3.First().B.BId != 1 && data3.First().B.BName != "a"&& data3.First().b!=1) + { + throw new Exception("unit error"); + } + } [SqlSugar.SugarTable("unita1")] public class A