我正在尝试使用Where子句的多连接。
SQL代码具有以下工作
SELECT...
FROM clients as c
JOIN members as m ON
(
c.Id = m.clientId AND
c.groupId = m.groupId AND
c.created < m.created
)
LINQ代码 - 我不知道在哪里取悦&#39; Where&#39;条款
from c in clients
join m in members ON
{ClientId = c.Id,GroupId = c.groupId} equals
{ClientId = m.clientId, GroupId = m.groupId}
**(c.created&lt; m.created)缺失**
我在哪里放置c.created Where Clause
答案 0 :(得分:0)
LINQ中不能有非equals
连接条件。您可以使用其他WHERE
子句来获得相同的结果:
from c in clients
join m in members on
new {ClientId = c.Id,GroupId = c.groupId}
equals new {ClientId = m.clientId, GroupId = m.groupId}
where c.created < m.created