Skip to content

Add support for commands with result types#2

Merged
henningtandberg merged 1 commit intohenningtandberg:mainfrom
oklar:mando_with_return_results
Sep 17, 2025
Merged

Add support for commands with result types#2
henningtandberg merged 1 commit intohenningtandberg:mainfrom
oklar:mando_with_return_results

Conversation

@oklar
Copy link
Contributor

@oklar oklar commented Sep 17, 2025

Introduced ICommand<TResult> and ICommandHandler<TCommand, TResult> to support commands that return results. Updated Dispatcher with a new Dispatch<TResult> method to handle result-returning commands. Enhanced DependencyInjectionExtensions to register result-returning handlers.

Added unit tests (CommandWithResultTests) to verify the functionality of commands with results. Implemented a sample EchoCommand and EchoCommandHandler for testing.

Maintained backward compatibility with existing ICommand and ICommandHandler<TCommand> implementations while improving extensibility for more complex workflows.

Introduced `ICommand<TResult>` and `ICommandHandler<TCommand, TResult>` to support commands that return results. Updated `Dispatcher` with a new `Dispatch<TResult>` method to handle result-returning commands. Enhanced `DependencyInjectionExtensions` to register result-returning handlers.

Added unit tests (`CommandWithResultTests`) to verify the functionality of commands with results. Implemented a sample `EchoCommand` and `EchoCommandHandler` for testing.

Maintained backward compatibility with existing `ICommand` and `ICommandHandler<TCommand>` implementations while improving extensibility for more complex workflows.
@henningtandberg henningtandberg merged commit e51c7e8 into henningtandberg:main Sep 17, 2025
1 check passed
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.

2 participants