-
-
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.
Update documentation for
OnErrorResumeNext
- Loading branch information
1 parent
1347e1a
commit a255443
Showing
5 changed files
with
154 additions
and
19 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
Docs/SuperLinq.Docs/apidoc/SuperLinq.SuperEnumerable.OnErrorResumeNext.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,20 @@ | ||
--- | ||
uid: SuperLinq.SuperEnumerable.OnErrorResumeNext``1(System.Collections.Generic.IEnumerable{``0},System.Collections.Generic.IEnumerable{``0}) | ||
example: [*content] | ||
--- | ||
The following code example demonstrates how to concatenate multiple sequences, regardless of any errors that may occur, using `OnErrorResumeNext`. | ||
[!code-csharp[](SuperLinq/OnErrorResumeNext/OnErrorResumeNext1.linq#L6-)] | ||
|
||
--- | ||
uid: SuperLinq.SuperEnumerable.OnErrorResumeNext``1(System.Collections.Generic.IEnumerable{``0}[]) | ||
example: [*content] | ||
--- | ||
The following code example demonstrates how to concatenate multiple sequences, regardless of any errors that may occur, using `OnErrorResumeNext`. | ||
[!code-csharp[](SuperLinq/OnErrorResumeNext/OnErrorResumeNext2.linq#L6-)] | ||
|
||
--- | ||
uid: SuperLinq.SuperEnumerable.OnErrorResumeNext``1(System.Collections.Generic.IEnumerable{System.Collections.Generic.IEnumerable{``0}}) | ||
example: [*content] | ||
--- | ||
The following code example demonstrates how to concatenate multiple sequences, regardless of any errors that may occur, using `OnErrorResumeNext`. | ||
[!code-csharp[](SuperLinq/OnErrorResumeNext/OnErrorResumeNext3.linq#L6-)] |
21 changes: 21 additions & 0 deletions
21
Docs/SuperLinq.Docs/apidoc/SuperLinq/OnErrorResumeNext/OnErrorResumeNext1.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,21 @@ | ||
<Query Kind="Statements"> | ||
<NuGetReference>SuperLinq</NuGetReference> | ||
<Namespace>SuperLinq</Namespace> | ||
</Query> | ||
|
||
// this sequence will throw an exception on the 6th element | ||
var sequence = Enumerable.Range(1, 5) | ||
.Concat(SuperEnumerable.Throw<int>(new InvalidOperationException())); | ||
|
||
// Skip over the error and enumerate the second sequence | ||
var result = sequence | ||
.OnErrorResumeNext( | ||
Enumerable.Range(1, 5)); | ||
|
||
Console.WriteLine( | ||
"[" + | ||
string.Join(", ", result) + | ||
"]"); | ||
|
||
// This code produces the following output: | ||
// [1, 2, 3, 4, 5, 1, 2, 3, 4, 5] |
22 changes: 22 additions & 0 deletions
22
Docs/SuperLinq.Docs/apidoc/SuperLinq/OnErrorResumeNext/OnErrorResumeNext2.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,22 @@ | ||
<Query Kind="Statements"> | ||
<NuGetReference>SuperLinq</NuGetReference> | ||
<Namespace>SuperLinq</Namespace> | ||
</Query> | ||
|
||
// this sequence will throw an exception on the 6th element | ||
var sequence = Enumerable.Range(1, 5) | ||
.Concat(SuperEnumerable.Throw<int>(new InvalidOperationException())); | ||
|
||
// Skip over the error and enumerate the second sequence | ||
var result = SuperEnumerable | ||
.OnErrorResumeNext( | ||
sequence, | ||
Enumerable.Range(1, 5)); | ||
|
||
Console.WriteLine( | ||
"[" + | ||
string.Join(", ", result) + | ||
"]"); | ||
|
||
// This code produces the following output: | ||
// [1, 2, 3, 4, 5, 1, 2, 3, 4, 5] |
20 changes: 20 additions & 0 deletions
20
Docs/SuperLinq.Docs/apidoc/SuperLinq/OnErrorResumeNext/OnErrorResumeNext3.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,20 @@ | ||
<Query Kind="Statements"> | ||
<NuGetReference>SuperLinq</NuGetReference> | ||
<Namespace>SuperLinq</Namespace> | ||
</Query> | ||
|
||
// this sequence will throw an exception on the 6th element | ||
var sequence = Enumerable.Range(1, 5) | ||
.Concat(SuperEnumerable.Throw<int>(new InvalidOperationException())); | ||
|
||
// Skip over the error and enumerate the second sequence | ||
var result = new[] { sequence, Enumerable.Range(1, 5), } | ||
.OnErrorResumeNext(); | ||
|
||
Console.WriteLine( | ||
"[" + | ||
string.Join(", ", result) + | ||
"]"); | ||
|
||
// This code produces the following output: | ||
// [1, 2, 3, 4, 5, 1, 2, 3, 4, 5] |
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