This repository has been archived by the owner on Feb 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 90
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 #78 from jbogard/update-to-8-0
Update to 8.0
- Loading branch information
Showing
10 changed files
with
224 additions
and
10 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
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
using System.IO; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using MediatR.Pipeline; | ||
|
||
namespace TestApp | ||
{ | ||
public class PingPongExceptionHandlerForType : IRequestExceptionHandler<Ping, Pong, ApplicationException> | ||
{ | ||
public Task Handle(Ping request, ApplicationException exception, RequestExceptionHandlerState<Pong> state, CancellationToken cancellationToken) | ||
{ | ||
state.SetHandled(new Pong { Message = exception.Message + " Handled by Type" }); | ||
|
||
return Task.CompletedTask; | ||
} | ||
} | ||
|
||
public class PingPongExceptionActionForType1 : IRequestExceptionAction<Ping, ApplicationException> | ||
{ | ||
private readonly TextWriter _output; | ||
|
||
public PingPongExceptionActionForType1(TextWriter output) => _output = output; | ||
|
||
public Task Execute(Ping request, ApplicationException exception, CancellationToken cancellationToken) | ||
=> _output.WriteLineAsync("Logging exception 1"); | ||
} | ||
|
||
public class PingPongExceptionActionForType2 : IRequestExceptionAction<Ping, ApplicationException> | ||
{ | ||
private readonly TextWriter _output; | ||
|
||
public PingPongExceptionActionForType2(TextWriter output) => _output = output; | ||
|
||
public Task Execute(Ping request, ApplicationException exception, CancellationToken cancellationToken) | ||
=> _output.WriteLineAsync("Logging exception 2"); | ||
} | ||
|
||
|
||
} |
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