score:0

It looks like you may need to use the "let" keyword c# linq supports,

Here is an example (from LinqPad)

from p in Products let spanishOrders = p.OrderDetails .Where (o => o.Order.ShipCountry == "Spain") where spanishOrders.Any() orderby p.ProductName select new {
p.ProductName,
TotalValue = spanishOrders.Sum (o > => o.UnitPrice * o.Quantity) }


Related Articles