Add multi-table query syntax sugar

This commit is contained in:
sunkaixuna
2021-10-01 21:41:03 +08:00
parent 3396e12c0a
commit b6684e8b73
4 changed files with 93 additions and 0 deletions

View File

@@ -400,6 +400,15 @@ namespace OrmTest
).Select(o=>o).ToList();
var query5 = db.Queryable<Order>()
.InnerJoin<Custom>((o, cus) => o.CustomId == cus.Id)
.InnerJoin<OrderItem>((o, cus, oritem) => o.Id == oritem.OrderId)
.Where((o) => o.Id == 1)
.Select((o, cus) => new ViewOrder { Id=o.Id, CustomName = cus.Name })
.ToList();
Console.WriteLine("#### Join Table End ####");
}