我有下面的SQL查詢,我能夠conert到LINQ轉換SQL查詢LINQ與一組由
select count(*), BatchID
from TimeSheetHeader
group by BatchID having count(*) > 1
轉換爲
var duplicateBatchIDList = from c in _db.TimeSheetHeaders
group c by c.BatchID into grp
where grp.Count() > 1
select grp;
但現在我試圖拋出額外的列沒有包含在組中。我有SQL查詢
select count(*), BatchID, TimeSheetCreationDate = min(TimeSheetCreationDate )
from TimeSheetHeader
where TimeSheetCreationDate >= CURRENT_TIMESTAMP
group by BatchID having count(*) > 1
,但我不知道如何將它轉換到LINQ
請檢查我的答案呃 – user449689