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?
UPDATE 1: My current code
var q = from c in sXDocument.Descendants("prop")
let handle = c.Element("handle")
let resultref = handle != null ? handle.Element("dsref") : null
let orderno = (string)c.Element("orderno")
let orderdetail = _relationContext.Order
.Where(x => x.orderno == orderno)
.Select(x => new { x.ProductID, x.OrderDate }).Single()
select new Order()
{
OrderNo = orderno,
Handle = resultref != null ? (string)resultref.Attribute("handle") : null,
Title = //Need ProductName,
ProductID = orderdetail.ProductID.ToString(),
};
return q.ToList();
I figured that if I could use a join in let keyword so I could get the product name