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

Support sync/async execute fixer on returning commands too #35

Merged
merged 2 commits into from
Nov 2, 2022

Conversation

kzu
Copy link
Member

@kzu kzu commented Nov 1, 2022

Previously we did not consider those as candidates for the fix.

Previously we did not consider those as candidates for the fix.
@kzu kzu enabled auto-merge (rebase) November 1, 2022 19:52
Implementing command handlers is a bit tricky when the command returns a value, since you need to specify both the command type and its return type in the ICommandHandler<T, TResult> declaration. Changes in the command definition (adding a return type or changing it) result in hard to read compiler errors which can be discouraging.

The new analyzer will detect these situations:
- Missing return type for a non-void command
- Mismatched return type

And we offer code fixers that fix both scenarios, including rewriting the Execute method to have the correct return type.

Closes #37
@kzu kzu merged commit e287f3e into main Nov 2, 2022
@kzu kzu deleted the feature/handlerfixer branch November 2, 2022 19:05
@kzu kzu added the enhancement New feature or request label Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant