2 using System.Collections.Generic;
\r
5 // Tests caching of closed generic anonymous delegates
\r
9 public static decimal Average<TSource> (this IEnumerable<TSource> source, Func<TSource, decimal> selector)
\r
11 return source.Select (selector).Average<decimal, decimal, decimal> ((a, b) => a + b, (a, b) => a / b);
\r
14 static TResult Average<TElement, TAggregate, TResult> (this IEnumerable<TElement> source,
\r
15 Func<TAggregate, TElement, TAggregate> func, Func<TAggregate, TElement, TResult> result)
\r
16 where TElement : struct
\r
17 where TAggregate : struct
\r
18 where TResult : struct
\r
20 throw new InvalidOperationException ();
\r
23 public static void Main ()
\r