This commit is contained in:
sunkaixuan 2017-08-25 13:18:43 +08:00
parent 8a91c7fb88
commit 2e462e4f38

View File

@ -1,5 +1,6 @@
using OrmTest.Demo;
using OrmTest.Models;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
@ -16,8 +17,19 @@ namespace OrmTest.Demo
{
Where();
OrderBy();
SelectMerge();
}
private static void SelectMerge()
{
var db = GetInstance();
//page join
var pageJoin = db.Queryable<Student, School>((st, sc) => new object[] {
JoinType.Left,st.SchoolId==sc.Id
})
.Select((st, sc) => new { id = st.Id, name = sc.Name })
.SelectMergeAsTable().Where(XXX => XXX.id == 1).OrderBy("name asc").ToList();// Prefix, is, not, necessary, and take the columns in select
}
private static void Where()
{
var db = GetInstance();