Skip to content

Commit

Permalink
chore: add ToErrorOrAsync to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
davidferneding committed Nov 14, 2024
1 parent e713126 commit bd91f89
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,16 @@ public ErrorOr<int> MultipleErrorsToErrorOr()

## Using The `ToErrorOr` Extension Method

### Values

```cs
ErrorOr<int> result = 5.ToErrorOr();
ErrorOr<int> result = await Task.FromResult(5).ToErrorOrAsync();
```

### Errors

```cs
ErrorOr<int> result = Error.Unexpected().ToErrorOr<int>();
ErrorOr<int> result = new[] { Error.Validation(), Error.Validation() }.ToErrorOr<int>();
```
Expand Down

0 comments on commit bd91f89

Please sign in to comment.