Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add implemenation for SendAsync return type #1

Merged
merged 4 commits into from
Jul 10, 2024

Conversation

JimGeersinga
Copy link
Owner

No description provided.

Refactored the `App` class to use a fluent API for chaining mediator commands, replacing the `Chain` method with `Add` and `FailWhen` methods. Updated `SendAsync` to return a specific type and used the null-forgiving operator in `Console.WriteLine`.

Modified `Command1Handler` to return `Error.Failure` instead of the request parameter.

Updated `MediatR.Chained.Console.csproj` to include `ErrorOr` package and added `InternalsVisibleTo` for the test project.

Improved documentation and changed the generic type parameter in `MediatorExtensions` from `T` to `TResponse`. Updated `SendAsync` methods to use the new `IMediatorChain` interface.

Refactored `MediatorChainTests` to use the new `MediatorChain` and `IMediatorChain` interfaces, adding a new test for the `FailWhen` condition.

Refactored `IMediatorChain` to remove the generic base type and added a new `SendAsync` method. Updated `IMediatorChain<TPrevious>` accordingly.

Removed `ErrorOr` package reference from `MediatR.Chained.csproj` and added `InternalsVisibleTo` for the test project.

Refactored `MediatorChain` to remove the generic base type and use a new `MediatorChainStep` class. Updated `SendAsync` to handle new step types and return the appropriate response type.

Removed `Chain` method from `MediatorExtensions` and added a new `Add` method to initialize a new `MediatorChain`.

Added a new `MediatorChainStep` class to represent steps in the mediator chain, including step type and predicate function.
@JimGeersinga JimGeersinga merged commit 81244e2 into master Jul 10, 2024
1 check passed
@JimGeersinga JimGeersinga deleted the ErrorOr-implementation branch July 10, 2024 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant