【发布时间】:2021-02-04 14:05:15
【问题描述】:
我尝试按照以下示例翻译此查询: linq to sql join on multiple columns using lambda
from tabA in this.context.TabA
join tabB in this.context.TabB on
new
{
field1 = tabA.Soc,
field2 = tabA.ID
}
equals new
{
field1 = TabB.Soc,
field2 = TabB.Code
}
select tabA;
用这个:
var query= this.context.TabA.Join(
this.context.TabB,
s => new { s.Soc, s.ID },
h => new { h.Soc, h.Code },
(s, h) => s);
【问题讨论】: