我是 Linq 世界的新手,由于数据库中的一些约束影响添加我需要的一些字段,我无法弄清楚如何将以下 sql 转换为 linq:
select sp.SessionID,
sp.SessionParticipationID,
case when z.SessionParticipationID = sp.SessionParticipationID then 1 else 0 end as RecordedFL
from SessionParticipation sp
inner join (
select sp1.SessionID,
sp1.SessionParticipationID
from Meeting.SessionParticipation sp1
inner join RegistrantActivity ra on ra.SessionParticipationID = sp1.SessionParticipationID
where ra.RegistrantID = 12345
) z on z.SessionID = sp.SessionID
实体是 SessionParticipation 和 RegistrantActivity