For joins, I strongly prefer the query syntax for all details that are happily hidden (not the least of which are transparent identifiers associated with intermediate projections, on paths that are obvious in the syntax-point equivalent). However, you asked about Lambdas, which I think you have everything you need - you just need to put it all together.
var categorizedProducts = product .Join(productcategory, p => p.Id, pc => pc.ProdId, (p, pc) => new { p, pc }) .Join(category, ppc => ppc.pc.CatId, c => c.Id, (ppc, c) => new { ppc, c }) .Select(m => new { ProdId = m.ppc.p.Id,
If you need, you can save the connection in a local variable and reuse it later, however, without other details, on the contrary, I see no reason to introduce a local variable.
Alternatively, you can throw Select into the last lambda of the second Join (again, if there are no other operations depending on the results of the join), which will give:
var categorizedProducts = product .Join(productcategory, p => p.Id, pc => pc.ProdId, (p, pc) => new { p, pc }) .Join(category, ppc => ppc.pc.CatId, c => c.Id, (ppc, c) => new { ProdId = ppc.p.Id,
... and having made the last attempt to sell you on the query syntax, it will look like this:
var categorizedProducts = from p in product join pc in productcategory on p.Id equals pc.ProdId join c in category on pc.CatId equals c.Id select new { ProdId = p.Id,
Your hands may be tied to having query syntax. I know that some stores have such credentials - often based on the notion that the query syntax is somewhat more limited than the point syntax. There are other reasons, such as "why should I learn the second syntax if I can do everything and much more in point syntax?" As this last part shows, there are details that hide the query syntax that can make it worth covering with the improved readability that it brings: all those intermediate projections and identifiers that you have to prepare, fortunately, are not front and center, stage in query syntax - they are the background. Now from my soapbox - anyway, thanks for the question. :)