|
@ -284,6 +284,15 @@ namespace OrmTest |
|
|
var query2 = db.Queryable<Custom>(); |
|
|
var query2 = db.Queryable<Custom>(); |
|
|
var list3=db.Queryable(query1, query2,JoinType.Left, (p1, p2) => p1.CustomId == p2.Id).Select<ViewOrder>().ToList(); |
|
|
var list3=db.Queryable(query1, query2,JoinType.Left, (p1, p2) => p1.CustomId == p2.Id).Select<ViewOrder>().ToList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
db.Queryable<Order>() |
|
|
|
|
|
.Select(it => new { id = it.Id }) |
|
|
|
|
|
.MergeTable()//合并成一个表 和 OrderItem 进行JOIN
|
|
|
|
|
|
.LeftJoin<OrderItem>((x, y) => x.id == y.ItemId) |
|
|
|
|
|
.Select((x, y) => new { xid = x.id, yid = y.ItemId }) |
|
|
|
|
|
.MergeTable()//合并成一个表 和 OrderItem 进行JOIN
|
|
|
|
|
|
.LeftJoin<OrderItem>((x, y) => x.yid == y.ItemId)// 最后一个表不是匿名对象就行
|
|
|
|
|
|
.ToList(); |
|
|
Console.WriteLine("#### Join Table End ####"); |
|
|
Console.WriteLine("#### Join Table End ####"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|