hi how to convert this sql query to linq query? in asp.net
SELECT distinct P.Pid,P.Name,PC.categoryName,
(select count(id) from POrderdetails where id=p.Pid)as detailsCount
FROM PTable P INNER JOIN PCATEGORY PC ON PC.pcategoryId=P.pCategoryId
ORDER BY detailsCount desc