-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bc43d2e
commit b661798
Showing
4 changed files
with
69 additions
and
16 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
Docs/SuperLinq.Docs/apidoc/SuperLinq.SuperEnumerable.ForEach.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
uid: SuperLinq.SuperEnumerable.ForEach``1(System.Collections.Generic.IEnumerable{``0},System.Action{``0}) | ||
example: [*content] | ||
--- | ||
The following code example demonstrates how to immediately execute an action on every element of a sequence using `ForEach`. | ||
[!code-csharp[](SuperLinq/ForEach/ForEach1.linq#L6-)] | ||
|
||
--- | ||
uid: SuperLinq.SuperEnumerable.ForEach``1(System.Collections.Generic.IEnumerable{``0},System.Action{``0,System.Int32}) | ||
example: [*content] | ||
--- | ||
The following code example demonstrates how to immediately execute an action on every element of a sequence using `ForEach`. | ||
[!code-csharp[](SuperLinq/ForEach/ForEach2.linq#L6-)] |
13 changes: 13 additions & 0 deletions
13
Docs/SuperLinq.Docs/apidoc/SuperLinq/ForEach/ForEach1.linq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<Query Kind="Statements"> | ||
<NuGetReference>SuperLinq</NuGetReference> | ||
<Namespace>SuperLinq</Namespace> | ||
</Query> | ||
|
||
var sequence = Enumerable.Range(1, 5); | ||
|
||
// Fold a sequence into a single value. | ||
sequence | ||
.ForEach(x => Console.Write($"{x}, ")); | ||
|
||
// This code produces the following output: | ||
// 1, 2, 3, 4, 5, |
13 changes: 13 additions & 0 deletions
13
Docs/SuperLinq.Docs/apidoc/SuperLinq/ForEach/ForEach2.linq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<Query Kind="Statements"> | ||
<NuGetReference>SuperLinq</NuGetReference> | ||
<Namespace>SuperLinq</Namespace> | ||
</Query> | ||
|
||
var sequence = Enumerable.Range(1, 5); | ||
|
||
// Fold a sequence into a single value. | ||
sequence | ||
.ForEach((x, i) => Console.Write($"({x}, {i}), ")); | ||
|
||
// This code produces the following output: | ||
// (1, 0), (2, 1), (3, 2), (4, 3), (5, 4), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters