如何将此SQL转换为EF LINQ

时间:2019-06-27 07:52:30

标签: sql-server entity-framework linq

如何将sql转换为linq,实体?

select Productdeltail.*,tv.sale,tv.idsale,tv.dateTo,tv.datefrom 
from Productdeltail
left join 
    (select SaleDetail.idProduct, SaleDetail.idSize, SaleDetail.sale,Sale.idsale,dateTo,datefrom from SaleDetail
    join Sale on SaleDetail.idsale = Sale.idsale 
    where (GETDATE() >= Sale.dateTo and GETDATE() <= Sale.datefrom ) ) tv on Productdeltail.idProduct= tv.idProduct and Productdeltail.idSize= tv.idSize

0 个答案:

没有答案