Browse Source

Add unit test

pull/33/head
sunkaixuan 1 year ago
parent
commit
41b853d63e
  1. 2
      Src/Asp.NetCore2/SqlSeverTest/Program.cs
  2. 10
      Src/Asp.NetCore2/SqlSeverTest/UnitTest/UnitSubToList.cs

2
Src/Asp.NetCore2/SqlSeverTest/Program.cs

@ -12,7 +12,7 @@ namespace OrmTest
/// <param name="args"></param>
static void Main(string[] args)
{
UnitSubToList.Init();
//Demo
Demo0_SqlSugarClient.Init();
Demo1_Queryable.Init();

10
Src/Asp.NetCore2/SqlSeverTest/UnitTest/UnitSubToList.cs

@ -70,7 +70,17 @@ namespace OrmTest
var list = query.ToList();
var query2 = db.Queryable<Demo_Comment>()
.LeftJoin<Order>((u,p)=>true)
.Where(u => u.ArticleId == 100)
.Select(u => new SysCommentOutput
{
SysUser = SqlFunc.Subqueryable<Demo_User>().Where(user => user.Id == u.UserId).First<SysUserOutput>(),
SysUsers = SqlFunc.Subqueryable<Demo_User>().Where(user => user.Id == u.UserId).ToList<SysUserOutput>()
}, true);
var list22 = query2.ToList();
}
//评论表

Loading…
Cancel
Save