如何为dotnet核心联接中的“ on”赋予多个条件

时间:2018-06-22 11:30:05

标签: c# entity-framework-6 asp.net-core-webapi

如何在dotnet核心连接中为“ on”赋予多个条件-

from x in this.context.RegulatoryUpdates
join m in this.context.RegulatoryUpdateClient on **x.Id equals m.RegulatoryupdateId  and  id = 25** into m
from z in m.DefaultIfEmpty()

1 个答案:

答案 0 :(得分:0)

您需要创建匿名对象:

from x in this.context.RegulatoryUpdates
join m in this.context.RegulatoryUpdateClient on new { x.Id, id } equals new { Id = m.RegulatoryupdateId, id = 25 } into m
from z in m.DefaultIfEmpty()