|
400 | 400 | </Attributes> |
401 | 401 | </Parameter> |
402 | 402 | </Parameters> |
403 | | - <Docs> |
404 | | - <typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam> |
405 | | - <typeparam name="TKey">The type of the key returned by <paramref name="keySelector" />.</typeparam> |
406 | | - <typeparam name="TAccumulate">The type of the accumulator value.</typeparam> |
407 | | - <param name="source">An <see cref="T:System.Collections.Generic.IEnumerable`1" /> to aggregate over.</param> |
408 | | - <param name="keySelector">A function to extract the key for each element.</param> |
409 | | - <param name="seedSelector">A factory for the initial accumulator value.</param> |
410 | | - <param name="func">An accumulator function to be invoked on each element.</param> |
411 | | - <param name="keyComparer">An <see cref="T:System.Collections.Generic.IEqualityComparer`1" /> to compare keys with.</param> |
412 | | - <summary>Applies an accumulator function over a sequence, grouping results by key.</summary> |
413 | | - <returns>An enumerable containing the aggregates corresponding to each key deriving from <paramref name="source" />.</returns> |
414 | | - <remarks> |
415 | | - This method is comparable to the <see cref="M:System.Linq.Enumerable.GroupBy``2(System.Collections.Generic.IEnumerable{``0},System.Func{``0,``1})" /> methods where each grouping is being aggregated into a single value as opposed to allocating a collection for each group. |
416 | | - </remarks> |
417 | | - </Docs> |
| 403 | + <Docs> |
| 404 | + <typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam> |
| 405 | + <typeparam name="TKey">The type of the key returned by <paramref name="keySelector" />.</typeparam> |
| 406 | + <typeparam name="TAccumulate">The type of the accumulator value.</typeparam> |
| 407 | + <param name="source">An <see cref="T:System.Collections.Generic.IEnumerable`1" /> to aggregate over.</param> |
| 408 | + <param name="keySelector">A function to extract the key for each element.</param> |
| 409 | + <param name="seedSelector">A factory for the initial accumulator value.</param> |
| 410 | + <param name="func">An accumulator function to be invoked on each element.</param> |
| 411 | + <param name="keyComparer">An <see cref="T:System.Collections.Generic.IEqualityComparer`1" /> to compare keys with.</param> |
| 412 | + <summary>Applies an accumulator function over a sequence, grouping results by key.</summary> |
| 413 | + <returns>An enumerable containing the aggregates corresponding to each key deriving from <paramref name="source" />.</returns> |
| 414 | + <remarks> |
| 415 | + <format type="text/markdown"><![CDATA[ |
| 416 | + |
| 417 | +## Remarks |
| 418 | + |
| 419 | +This method is comparable to the <xref:System.Linq.Enumerable.GroupBy``2(System.Collections.Generic.IEnumerable{``0},System.Func{``0,``1})> methods where each grouping is aggregated into a single value as opposed to allocating a collection for each group. |
| 420 | + |
| 421 | +## Examples |
| 422 | + |
| 423 | +The following example demonstrates how to use `AggregateBy` with a seed selector to compute multiple values per key. |
| 424 | + |
| 425 | +:::code language="csharp" source="~/snippets/csharp/System.Linq/Enumerable/AggregateTSource/enumerable.cs" id="Snippet205"::: |
| 426 | + |
| 427 | + ]]></format> |
| 428 | + </remarks> |
| 429 | + </Docs> |
418 | 430 | </Member> |
419 | 431 | <Member MemberName="AggregateBy<TSource,TKey,TAccumulate>"> |
420 | 432 | <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TAccumulate>> AggregateBy<TSource,TKey,TAccumulate> (this System.Collections.Generic.IEnumerable<TSource> source, Func<TSource,TKey> keySelector, TAccumulate seed, Func<TAccumulate,TSource,TAccumulate> func, System.Collections.Generic.IEqualityComparer<TKey>? keyComparer = default);" /> |
|
478 | 490 | </Parameter> |
479 | 491 | </Parameters> |
480 | 492 | <Docs> |
481 | | - <typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam> |
482 | | - <typeparam name="TKey">The type of the key returned by <paramref name="keySelector" />.</typeparam> |
483 | | - <typeparam name="TAccumulate">The type of the accumulator value.</typeparam> |
484 | | - <param name="source">An <see cref="T:System.Collections.Generic.IEnumerable`1" /> to aggregate over.</param> |
485 | | - <param name="keySelector">A function to extract the key for each element.</param> |
486 | | - <param name="seed">The initial accumulator value.</param> |
487 | | - <param name="func">An accumulator function to be invoked on each element.</param> |
488 | | - <param name="keyComparer">An <see cref="T:System.Collections.Generic.IEqualityComparer`1" /> to compare keys with.</param> |
489 | | - <summary>Applies an accumulator function over a sequence, grouping results by key.</summary> |
490 | | - <returns>An enumerable containing the aggregates corresponding to each key deriving from <paramref name="source" />.</returns> |
491 | | - <remarks> |
492 | | - This method is comparable to the <see cref="M:System.Linq.Enumerable.GroupBy``2(System.Collections.Generic.IEnumerable{``0},System.Func{``0,``1})" /> methods where each grouping is being aggregated into a single value as opposed to allocating a collection for each group. |
493 | | - </remarks> |
494 | | - </Docs> |
| 493 | + <typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam> |
| 494 | + <typeparam name="TKey">The type of the key returned by <paramref name="keySelector" />.</typeparam> |
| 495 | + <typeparam name="TAccumulate">The type of the accumulator value.</typeparam> |
| 496 | + <param name="source">An <see cref="T:System.Collections.Generic.IEnumerable`1" /> to aggregate over.</param> |
| 497 | + <param name="keySelector">A function to extract the key for each element.</param> |
| 498 | + <param name="seed">The initial accumulator value.</param> |
| 499 | + <param name="func">An accumulator function to be invoked on each element.</param> |
| 500 | + <param name="keyComparer">An <see cref="T:System.Collections.Generic.IEqualityComparer`1" /> to compare keys with.</param> |
| 501 | + <summary>Applies an accumulator function over a sequence, grouping results by key.</summary> |
| 502 | + <returns>An enumerable containing the aggregates corresponding to each key deriving from <paramref name="source" />.</returns> |
| 503 | + <remarks> |
| 504 | + <format type="text/markdown"><![CDATA[ |
| 505 | + |
| 506 | +## Remarks |
| 507 | + |
| 508 | +This method is comparable to the <xref:System.Linq.Enumerable.GroupBy``2(System.Collections.Generic.IEnumerable{``0},System.Func{``0,``1})> methods where each grouping is being aggregated into a single value as opposed to allocating a collection for each group. |
| 509 | + |
| 510 | +## Examples |
| 511 | + |
| 512 | +The following example demonstrates how to use `AggregateBy` with a constant seed value to compute totals per key. |
| 513 | + |
| 514 | +:::code language="csharp" source="~/snippets/csharp/System.Linq/Enumerable/AggregateTSource/enumerable.cs" id="Snippet206"::: |
| 515 | + |
| 516 | + ]]></format> |
| 517 | + </remarks> |
| 518 | + </Docs> |
495 | 519 | </Member> |
496 | 520 | <Member MemberName="All<TSource>"> |
497 | 521 | <MemberSignature Language="C#" Value="public static bool All<TSource> (this System.Collections.Generic.IEnumerable<TSource> source, Func<TSource,bool> predicate);" /> |
|
0 commit comments