Having the following C# linq query:
var result =
from member in members
let BestPriceLength =
(from lumber in lumbers
where member.Thickness == lumber.Thickness && member.Width == lumber.Width && member.Length <= lumber.Length
select lumber).Min(l => l.Price / l.Length)
let BestLengthFromBestPrice = ??????
select new
{
Member = member,
MemberLength = member.Length,
BestLengthFromBestPrice ,
Ratio = member.Length / BestLengthFromBestPrice,
};
I don't know how to get the lumber's length chosen by for the BestPriceLength variable into the other parts of the result.
Anyone with a clever idea?