Skip to content

Commit

Permalink
bump version to 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
amantinband committed Aug 8, 2024
1 parent 7d318a2 commit 3b081da
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,26 @@ errorOr.FailIf(x => x > 0, Error.Failure());
-public static async Task<ErrorOr<TValue>> ThenAsync<TValue>(this Task<ErrorOr<TValue>> errorOr, Func<TValue, Task> action)
+public static async Task<ErrorOr<TValue>> ThenDoAsync<TValue>(this Task<ErrorOr<TValue>> errorOr, Func<TValue, Task> action)
```

## [2.1.0] - 2024-08-08

### Added

- Added `FailIf` `Func<TValue, Error>` overloads (thanks [@ahmtsen](https://github.com/ahmtsen)!)

```cs
public async Task<ErrorOr<TValue>> FailIfAsync(Func<TValue, Task<bool>> onValue, Func<TValue, Task<Error>> errorBuilder)
```

```cs
public static async Task<ErrorOr<TValue>> FailIfAsync<TValue>(
this Task<ErrorOr<TValue>> errorOr,
Func<TValue, Task<bool>> onValue,
Func<TValue, Task<Error>> errorBuilder)
```

```cs
// the value can now be used to build the error
ErrorOr<int> result = errorOrInt
.FailIf(num => num > 3, (num) => Error.Failure(description: $"{num} is greater than 3"));
```
2 changes: 1 addition & 1 deletion src/ErrorOr.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<PropertyGroup>
<PackageId>ErrorOr</PackageId>
<Version>2.0.1</Version>
<Version>2.1.0</Version>
<Authors>Amichai Mantinband</Authors>
<PackageIcon>icon-square.png</PackageIcon>
<PackageTags>Result,Results,ErrorOr,Error,Handling</PackageTags>
Expand Down

0 comments on commit 3b081da

Please sign in to comment.