-
Notifications
You must be signed in to change notification settings - Fork 3
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
Alberto Monteiro
committed
Nov 28, 2023
1 parent
e559cc2
commit a930531
Showing
15 changed files
with
98 additions
and
94 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
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
17 changes: 17 additions & 0 deletions
17
src/HandlingErrors.Core/RequestHandlers/Pipelines/ResultUtils.cs
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,17 @@ | ||
using OperationResult; | ||
using System.Reflection; | ||
|
||
namespace HandlingErrors.Core.RequestHandlers.Pipelines; | ||
|
||
public static class ResultUtils | ||
{ | ||
internal static MethodInfo ResultError { get; } | ||
internal static Type TypeResultGeneric { get; } = typeof(Result<>); | ||
internal static Type TypeResult { get; } = typeof(Result); | ||
|
||
static ResultUtils() | ||
=> ResultError = TypeResult.GetMethods().First(m => m.Name == "Error" && m.IsGenericMethod); | ||
|
||
internal static MethodInfo? GetGenericError(Type type) | ||
=> type.IsGenericType ? ResultError.MakeGenericMethod(type.GetGenericArguments().First()) : null; | ||
} |
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
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
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
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
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,16 +1,16 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<LangVersion>10</LangVersion> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<LangVersion>12</LangVersion> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>true</ImplicitUsings> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="AutoMapper" Version="11.0.1" /> | ||
<PackageReference Include="Divino.OperationResult" Version="3.0.0" /> | ||
<PackageReference Include="MediatR" Version="10.0.1" /> | ||
<PackageReference Include="AutoMapper" Version="12.0.1" /> | ||
<PackageReference Include="Divino.OperationResult" Version="3.1.0" /> | ||
<PackageReference Include="MediatR" Version="12.2.0" /> | ||
</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
14 changes: 7 additions & 7 deletions
14
tests/HandlingErrors.Core.Tests/HandlingErrors.Core.Tests.csproj
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
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
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
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
14 changes: 7 additions & 7 deletions
14
tests/HandlingErrors.Data.Tests/HandlingErrors.Data.Tests.csproj
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.