Can you explain brief about Aggregate() extension method in LINQ?
Answer Posted / Shilpi Tyagi
The Aggregate() extension method in LINQ is used to apply a user-defined aggregate function (like sum, product, min, max) to a sequence of elements. It takes two parameters: a seed value and a binary function that combines the elements into a single result.nExample:n```csharpnint[] numbers = { 1, 2, 3, 4, 5 };nint sum = numbers.Aggregate((acc, current) => acc + current); // sum will be 15```
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
No New Questions to Answer in this Category !! You can
Post New Questions
Answer Questions in Different Category