Linq Aggregate function
Posted
by Nyla Pareska
on Stack Overflow
See other posts from Stack Overflow
or by Nyla Pareska
Published on 2010-05-02T15:18:38Z
Indexed on
2010/05/04
18:18 UTC
Read the original article
Hit count: 285
I have a List like
"test", "bla", "something", "else"
But when I use the Aggrate on it and in the mean time call a function it seems to me that after 2 'iterations' the result of the first gets passed in?
I am using it like :
myList.Aggregate((current, next) => someMethod(current) + ", "+ someMethod(next));
and while I put a breakpoint in the someMethod function where some transformation on the information in the myList occurs, I notice that after the 3rd call I get a result from a former transformation as input paramter.
© Stack Overflow or respective owner