Class EnumerableExtensions
Extension methods for all kinds of (typed) enumerable data (Array, List, ...)
Inheritance
System.Object
EnumerableExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Kephas.Collections
Assembly: Kephas.Core.dll
Syntax
public static class EnumerableExtensions
Methods
| Improve this Doc View SourceForEach<T>(IEnumerable<T>, Action<T>)
Performs an action for each item in the enumerable.
Declaration
public static void ForEach<T>(this IEnumerable<T> values, Action<T> action)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T> | values | The data values. |
System.Action<T> | action | The action to be performed. |
Type Parameters
Name | Description |
---|---|
T | The enumerable data type. |
Remarks
This method was intended to return the passed values to provide method chaining. Howver due to defered execution the compiler would actually never run the entire code at all.
Examples
var values = new[] { "1", "2", "3" }; values.ConvertList<string, int>().ForEach(Console.WriteLine);