我有这个查询:
from p in IPACS_Procedures
where !(from pd in IPACS_ProcedureDocs
join d in IPACS_Documents on pd.DocumentID equals d.DocumentID
where d.DateDeleted == null && d.DateApproved != null
select pd.ProcedureID).Contains(p.ProcedureID)
select new { p.ProcedureID, p.Name }
上述工作,但我们有一个版本控制系统到位。我需要添加检查是否存在尚未批准的更高版本的功能。
上面的代码查找任何document (d)
未标记为 Deleted(DateDelete)
且已被批准的内容(DateApproved)
。
我需要添加检查版本表的功能,以查看是否有未经批准的版本以及是否已将其标记为已删除。
经过多次尝试,我似乎无法让它发挥作用。
d.IPACS_Versions.Where(v => v.revision > d.revision && v.dateDeleted == null)
规格:
d.DateDeleted must equal null to be valid
d.DateApproved must not be null to be valid
d will always have a record in IPACS_Versions but if the record in IPACS_Version
has a higher revision than d.revision and if the higher version then dateDeleted
must be null to be valid in the above list.