Extending Marc's answer you could use All
to add the items to p, but it's abusing All
a bit unless p.AddStuff
could fail.
(var qry = from item in itemlist
select new {item.X, item.Y,
Dummies = item.examples.Select(
ex => ex.GetDummy())
}).All(item=>{p.AddStuff(item.X, item.Y, item.Dummies.ToList()); return true;});
If p.AddStuff
can fail and you wanted to be sure all the items were added it would be completely appropriate to do it like this:
bool allAdded = (var qry = from item in itemlist
select new {item.X, item.Y,
Dummies = item.examples.Select(
ex => ex.GetDummy())
}).All(item=>p.AddStuff(item.X, item.Y, item.Dummies.ToList()));