左连接与联结表

时间:2015-10-01 11:25:35

标签: c# entity-framework linq

我有以下表格: -

- Visit
- Vehicles
- VehicleVisits (junction table of the above two)

我想要一个linq查询以使用VehicleVisits离开联接访问表 像这样:

from workOrder in dbContext.WorkOrders 
join visit in dbContext.Visits on workOrder.VisitID equals visit.ID         
from v in visit.Vehicles into leftJoin
from  leftJoin1 in leftJoin.DefaultIfEmpty()

但这个查询不正确
我该怎么办?

0 个答案:

没有答案