This question shows research effort; it is useful and clear
0
This question does not show any research effort; it is unclear or not useful
Bookmark this question.
Show activity on this post.
如何在 linq 中转换我的子查询?我的查询是:
select *
from Product
where ID in
(
select distinct(sku.ProductId)
from SiteProducts sp
inner join ProductSKU sku on sp.ProductId = sku.Id
where sp.siteid = 2
)
from p in db.Product
where (from sp in db.SiteProducts
join sku in db.ProductSKU on sp.ProductId equals sku.Id
where sp.siteid == 2
select sku.ProductId).Distinct().Contains(p.ID)
select p