0
我有點新LINQ,我想代表LINQ以下查詢到的實體:如何在LINQ中將這個SQL查詢表示爲實體?
Select * from Cotations CT1
where CT1.CotationID = iCot_ID and
Revision =
(select max(revision)
from Cotations CT2
where CT1.CotationID = CT2.Cotation)
其中iCot_ID
是外部參數,Cotations
是我的實體集。
更好的是,我怎樣才能把它表示爲兩個實體之間的關聯?
如果我有以下實體:
MasterLog:
--cotationID
Cotation:
--Cotationid
--revision鍵,
併爲每個MasterLog
我想哈與Cotation
關聯僅基於CotationID
其中Revision
最大爲cotation
(如上面的查詢)
謝謝。
Lukasz