我对 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