私はLINQを初めて使用しますが、SQLクエリをLINQに変換しようとして失敗しました。解決策を教えてください。このための正確なLINQは何ですか。よろしくお願いします。
//クエリ全体の一部
select distinct p.IdPatient,p.IdDoc
from patd p (NOLOCK)
left outer join StatusChange sc (NOLOCK)
on sc.IdPatient = p.IdPatient
and sc.IdClinicNumber = 23430
and sc.IdStatus = 'A'
and sc.DateStatusChange > GetDate()
join TrtTyp t ON p.IdTreatmentType = t.IdTreatmentType
and t.TypeModality IN ('H','P')
Where
p.IdType IN ('P','E','M')
and (IsNull(p.IsInactive,0) in (1,0) or sc.IdStatusChange is not null)
and Not Exists(
Select 1
From Expire e (NOLOCK)
Where e.IdPatient = p.IdPatient
)
and p.IdClinicNumber = 23430