This content is part of a third party extension that is not supported by the Cake project.
For more information about this extension see Cake.Incubator.
Summary
Performs an action on a collection of items
- Assembly
- Cake
.Incubator .dll - Namespace
- Cake
.Incubator . Enumerable Extensions - Containing Type
- EnumerableExtensions
Syntax
public static void Each<T>(this IEnumerable<T> source, Action<T> action)
Examples
Replace the following
foreach(var item in items)
{
Debug.WriteLine(item);
}
with
items.Each(item => Debug,WriteLine(item));
Type Parameters
Name | Description |
---|---|
T | The item type |
Parameters
Name | Type | Description |
---|---|---|
source | IEnumerable |
the collection |
action | Action |
the action to perform |
Return Value
Type | Description |
---|---|
void |