11 lines
271 B
C#
11 lines
271 B
C#
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
|
||
|
public static class AccumulateExtensions
|
||
|
{
|
||
|
public static IEnumerable<U> Accumulate<T, U>(this IEnumerable<T> collection, Func<T, U> func)
|
||
|
{
|
||
|
foreach (var elem in collection) yield return func(elem);
|
||
|
}
|
||
|
}
|