Beispiel #1
0
 /// <summary>
 /// <para/>Adds ForEach extension method.
 /// <para/>Throws if <paramref name="action"/> invocation throws.
 /// </summary>
 /// <param name="source">Collection to loop through. If null - return null.</param>
 /// <param name="action">Action that will be invoked for each element in <paramref name="source"/>. If null - returns <paramref name="source"/></param>
 /// <returns>Returns <paramref name="source"/> unchanged</returns>
 public static IEnumerable <T> ForEach <T>(this IEnumerable <T> source, Action <T> action)
 {
     return(source.ForEachA(action));
 }