I have the following query:
drivers.Select(d => { d.id = 0; d.updated = DateTime.Now; return d; }).ToList();
drivers is a List which com
Although this looks innocent, especially in combination with a ToList call that executes the code immediately, I would definitely stay away from modifying anything as part of a query: the trick is so unusual that it would trip up readers of your program, even experienced ones, especially if they never saw this before.
There's nothing wrong with foreach loops - the fact that you can do it with LINQ does not mean that you should be doing it.