-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from amantinband/error-or-2.0
ErrorOr 2.0
- Loading branch information
Showing
21 changed files
with
832 additions
and
577 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,15 +1,57 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
All notable changes to this project are documented in this file. | ||
|
||
## [1.10.0] - 2024-02-14 | ||
|
||
### Added | ||
- Forbidden Error Type | ||
|
||
- `ErrorType.Forbidden` | ||
- README to NuGet package | ||
|
||
## [1.9.0] - 2024-01-06 | ||
|
||
### Added | ||
|
||
- `ToErrorOr` | ||
|
||
## [2.0.0] - 2024-03-26 | ||
|
||
### Added | ||
- ToErrorOr | ||
|
||
### Fixed | ||
- Added Missing tests | ||
- `FailIf` | ||
|
||
```csharp | ||
public ErrorOr<TValue> FailIf(Func<TValue, bool> onValue, Error error) | ||
``` | ||
|
||
```csharp | ||
ErrorOr<int> errorOr = 1; | ||
errorOr.FailIf(x => x > 0, Error.Failure()); | ||
``` | ||
|
||
### Breaking Changes | ||
|
||
- `Then` that receives an action is now called `ThenDo` | ||
|
||
```diff | ||
-public ErrorOr<TValue> Then(Action<TValue> action) | ||
+public ErrorOr<TValue> ThenDo(Action<TValue> action) | ||
``` | ||
|
||
```diff | ||
-public static async Task<ErrorOr<TValue>> Then<TValue>(this Task<ErrorOr<TValue>> errorOr, Action<TValue> action) | ||
+public static async Task<ErrorOr<TValue>> ThenDo<TValue>(this Task<ErrorOr<TValue>> errorOr, Action<TValue> action) | ||
``` | ||
|
||
- `ThenAsync` that receives an action is now called `ThenDoAsync` | ||
|
||
```diff | ||
-public async Task<ErrorOr<TValue>> ThenAsync(Func<TValue, Task> action) | ||
+public async Task<ErrorOr<TValue>> ThenDoAsync(Func<TValue, Task> action) | ||
``` | ||
|
||
```diff | ||
-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) | ||
``` |
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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<Project> | ||
|
||
<PropertyGroup> | ||
<LangVersion>10.0</LangVersion> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<TreatWarningsAsErrors>True</TreatWarningsAsErrors> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
</Project> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<Project> | ||
|
||
<PropertyGroup> | ||
<LangVersion>10.0</LangVersion> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<TreatWarningsAsErrors>True</TreatWarningsAsErrors> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
</Project> |
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
Oops, something went wrong.