Given a setup like this ..
class Product {
int Cost;
// other properties unimportant
}
var products = new List {
new Product { Cost
You can do this if you want a solution without an external variable
var indexQuery = products.Select((x,index) => new { Obj = x, Index = index });
var query = from p in indexQuery
let RunningTotal = indexQuery.Where(x => x.Index <= p.Index)
.Sum(x => x.Obj.Cost)
where credit >= RunningTotal
select p.Obj;