22 lines
774 B
C#
22 lines
774 B
C#
|
namespace Caliburn.Micro.Core {
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Extension methods for <see cref="IEnumerable<T>"/>
|
|||
|
/// </summary>
|
|||
|
public static class EnumerableExtensions {
|
|||
|
/// <summary>
|
|||
|
/// Applies the action to each element in the list.
|
|||
|
/// </summary>
|
|||
|
/// <typeparam name="T">The enumerable item's type.</typeparam>
|
|||
|
/// <param name="enumerable">The elements to enumerate.</param>
|
|||
|
/// <param name="action">The action to apply to each item in the list.</param>
|
|||
|
public static void Apply<T>(this IEnumerable<T> enumerable, Action<T> action) {
|
|||
|
foreach (var item in enumerable) {
|
|||
|
action(item);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|