I\'d like to do the equivalent of the following in LINQ, but I can\'t figure out how:
IEnumerable items = GetItems(); items.ForEach(i => i.DoS
If you want to act as the enumeration rolls you should yield each item.
public static class EnumerableExtensions { public static IEnumerable ForEach(this IEnumerable enumeration, Action action) { foreach (var item in enumeration) { action(item); yield return item; } } }