Big Subjective Question: I often find myself using LINQ to filter a set of objects and then, after the query, doing an old fashion foreach to perform an action on each of the results. Is there a good way of combining these two tasks such that an action is performed on each object that matches the Where() predicate? Almost like passing an Action into the Select(). That probably would not compile, but what about passing in a Func that returns a bool, then you could nest that inside another query that could do something with the failures or successes. Has anyone done this in production code? Would this be considered bad practice? Any other thoughts?
Share
List<T>has aForEach()method that is designed for this.