LINQ equivalent of foreach for IEnumerable<T>
Asked 07 September, 2021
Viewed 2.8K times
  • 60
Votes

I'd like to do the equivalent of the following in LINQ, but I can't figure out how:

IEnumerable<Item> items = GetItems();
items.ForEach(i => i.DoStuff());

What is the real syntax?

22 Answer