Enumerable.Aggregateには3つのオーバーロードバージョンがあります。 official exampleで使用されているものと一致するこの関数のオーバーロードバージョンは見つかりませんでした。C#集約関数の定義の説明
public static TSource Aggregate<TSource>(
this IEnumerable<TSource> source,
Func<TSource, TSource, TSource> func
)
上記の定義は、この公式の例とは全く異なります。ここでは
string sentence = "the quick brown fox jumps over the lazy dog";
// Split the string into individual words.
string[] words = sentence.Split(' ');
// Prepend each word to the beginning of the
// new sentence to reverse the word order.
string reversed = words.Aggregate((workingSentence, next) =>
next + " " + workingSentence);
Console.WriteLine(reversed);
// This code produces the following output:
//
// dog lazy the over jumps fox brown quick the
は、集計関数の3つのオーバーロードバージョンです:それらの
public static TSource Aggregate<TSource>(this IEnumerable<TSource> source, Func<TSource, TSource, TSource> func);
public static TAccumulate Aggregate<TSource, TAccumulate>(this IEnumerable<TSource> source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func);
public static TResult Aggregate<TSource, TAccumulate, TResult>(this IEnumerable<TSource> source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func, Func<TAccumulate, TResult> resultSelector);
なしで使用される機能と一致していません上記の例。公式文書は間違っていますか?または私はsthを逃した? 3つのバージョンの関数定義とこの公式の例の間のギャップを埋めるのを助けてください。
機能定義の理解方法は?
実際に最初に過負荷を言いました**は**その公式の例で使用されているものと同じです**。 – Evk
[拡張方法](https://msdn.microsoft.com/en-us/library/bb383977.aspx)を確認してください。 –