Pankaj Pathak
Can you explain brief about Aggregate() extension method in LINQ?
By Pankaj Pathak in LINQ on May 12 2013
  • Munesh Sharma
    Jun, 2015 16

    http://www.dotnetperls.com/aggregate

    • 0
  • Munesh Sharma
    Jun, 2015 16

    http://www.dotnetperls.com/aggregate

    • 0
  • Bhabani Prasad
    May, 2014 21

    The delegate for the Aggregate extension method accepts two integer arguments and returns an integer value representing the sum of both input parameters. The Aggregate extension method loops through each element of the list and performs the operation returned by the delegate passed in. Alternatively, and instead of using lambda expressions, we could have used anonymous methods to write an inline delegate:foreach (List l in lstUserData) {lstSums.Add(l.Aggregate(delegate(int sum, int elmnt) { return sum elmnt;} )); }

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS