Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusz96 authored Oct 30, 2024
1 parent aa5cfa0 commit 107474f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ You can even define a fallback that will be executed after your entire chain:
var exceptionHandlersChain = new ResponsibilityChain<Exception, bool>(new ActivatorMiddlewareResolver())
.Chain<OutOfMemoryExceptionHandler>() // The order of middleware being chained matters
.Chain<ArgumentExceptionHandler>()
.Finally<DoSomething>();
.Finally<ExceptionHandlerFallback>();

public class DoSomething : IFinally<Exception, bool>
public class ExceptionHandlerFallback : IFinally<Exception, bool>
{
public bool Finally(Exception parameter)
{
Expand Down Expand Up @@ -202,9 +202,9 @@ If you want to, you can use the asynchronous version, using asynchronous middlew
var exceptionHandlersChain = new AsyncResponsibilityChain<Exception, bool>(new ActivatorMiddlewareResolver())
.Chain<OutOfMemoryAsyncExceptionHandler>() // The order of middleware being chained matters
.Chain<ArgumentAsyncExceptionHandler>()
.Finally<ExceptionHandlerFallback>();
.Finally<ExceptionHandlerAsyncFallback>();

public class ExceptionHandlerFallback : IAsyncFinally<Exception, bool>
public class ExceptionHandlerAsyncFallback : IAsyncFinally<Exception, bool>
{
public Task<bool> Finally(Exception parameter)
{
Expand Down Expand Up @@ -374,9 +374,9 @@ With:
var exceptionHandlersChain = new ResponsibilityChain<Exception, bool>(new ActivatorMiddlewareResolver())
.Chain<OutOfMemoryExceptionHandler>()
.Chain<ArgumentExceptionHandler>()
.Finally<DoSomething>();
.Finally<ExceptionHandlerFallback>();

public class DoSomething : IFinally<Exception, bool>
public class ExceptionHandlerFallback : IFinally<Exception, bool>
{
public bool Finally(Exception parameter)
{
Expand Down

0 comments on commit 107474f

Please sign in to comment.