Given the following object:
public class Product { string Name {get;} int Quantity {get;} }
using Linq, how would I query a Li
Li
You just create a variable to hold the sum, then add to it as each item in the list is tested with the where clause:
where
int sum = 0; from product in list where (sum += product.Quantity) < 8 select product