Can i use join with let in linq - c#

Posted by uno on Stack Overflow See other posts from Stack Overflow or by uno
Published on 2010-04-30T19:53:29Z Indexed on 2010/04/30 19:57 UTC
Read the original article Hit count: 203

Filed under:
|
let order= _relationContext.Orders 
             .Where(x => x.OrderNumber == orderNo)
             .Select(x => new { x.OrderNo, x.OrderDate }).Single()

I want to try and do something like this

let order = _relationContext.Orders join _relationContext.Products 
                     .Where(x => x.OrderNumber == orderNo && x.ProductId == Products.ProductID)
                     .Select(x => new { x.OrderNo, x.OrderDate }).Single()

Is this even possible?

© Stack Overflow or respective owner

Related posts about c#

Related posts about LINQ