我有这样的 SQL 查询
SELECT WI.[WorkItemID] ,[WorkItemNumber] ,[ToDate]
FROM [WorkItem] AS WI INNER JOIN [WorkItemTrack] AS WT on WI.WorkItemID=WT.WorkItemID
WHERE MAX([ToDate]) BETWEEN @StartDate AND @EndDate
和相应的实体框架查询是
workItems = from wi in workItems.Where(p => p.IsActive)
join wt in entityCollection.WorkItemTrack on wi.WorkItemID equals wt.WorkItem.WorkItemID
where wt.ToDate >= fromdate && wt.ToDate <= todate
select wi;
在这里,我无法在 Enitity Framework Query 中将 MAX 用于 wt.ToDate
请帮我