Select pm.ProductId, pm.Name, MIN(p.ListPrice) from SalesLT.ProductCategory pc, SalesLT.Product p, SalesLT.ProductModel pm
Where pm.ProductModelId = p.ProductModelId AND p.ProductCategoryID = pc.ProductCategoryID AND pc.ParentProductCategoryID = 2
Group By pm.ProductId, pm.Name
How do I translate this from SQL to linq?
I try this but I don't know how to select the MIN
var productList = from pc in db.ProductCategory
join p in db.Product on pc.ProductCategoryId equals p.ProductCategoryId
join pm in db.ProductModel on p.ProductModelId equals pm.ProductModelId
group pm by new { pm.ProductModelId, pm.Name } into g
select new { //i don't know what to do here now }