Skip to content

Commit b08b398

Browse files
committed
Fix Aggregate example
This fixes a bug in the sample code which used an overload that requires a seed value. The seed value is now provided.
1 parent cd6dff6 commit b08b398

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/concepts/linq.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ The following is a quick demonstration of some of the essential pieces of LINQ.
130130
select dog.TurnIntoACat();
131131
132132
// Summing then lengths of a set of strings
133-
int sumOfStrings = strings.Aggregate((s1, s2) => s1.Length + s2.Length);
133+
int seed = 0;
134+
int sumOfStrings = strings.Aggregate(seed, (s1, s2) => s1.Length + s2.Length);
134135
135136
* Flattening a list of lists:
136137

0 commit comments

Comments
 (0)