Extension methods, is this too dirty?
My advice: don't do this.


Building devices that encourage you to write expressions that are useful only for their side effects is poor functional style.
You are abusing "Select" when you use it as an implementation detail of "ForEach". "Select" does not have the semantics of "ForEach"!  The purpose of "Select" is to compute a projection, not to cause a side effect.
You are building yourself a little time bomb. Because your implemenation of ForEach is to build a Select query, the "ForEach" executes lazily.  When you say "blah.ForEach(whatever);" that doesn't do anything. It just builds up an object that represents doing the side effects in the future.  Since you never use that object for anything, the side effects remain undone.  If, by contrast, you do use that object, you run the risk of using it twice and causing the same side effects again.


That said, the idea of what you're doing is sound; the idea of representing a sequence of side-effecting operations in a lazily-evaluated object is how side effects are represented in Haskell. But if that's what you want to do, then actually build yourself a real monad that clearly and unambiguosly represents the semantics of "I'm building an object that represents a sequence of side effects in the future". Don't be all coy about it! Be explicit that that's what you're doing.