foreach to linq code example
Example 1: foreach c# linq example
items.ToList().ForEach(i => i.DoStuff());
Example 2: ienumerable for each
items.ToList().ForEach(i => i.DoStuff());
// OR
foreach(T item in enumeration) {
// Actions
}
items.ToList().ForEach(i => i.DoStuff());
items.ToList().ForEach(i => i.DoStuff());
// OR
foreach(T item in enumeration) {
// Actions
}