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

Provide analyzer + code fix for turning sync command to async and viceversa #39

Merged
merged 1 commit into from
Nov 3, 2022

Conversation

kzu
Copy link
Member

@kzu kzu commented Nov 3, 2022

The new analyer detects the need for changes in the command definition itself, allowing the command handler to drive changes to it in a more automated fashion, as follows:

  • If during the command implementation, you find that the command needs to be made async, you can just change implemented interface in the handler from ICommandHandler > IAsyncCommandHandler and an analyzer + codefix will suggest changing the command from ICommand to IAsyncCommand in turn.
  • If during the implementation, you find that you'd like to return a value, or perhaps even change the return type you previously had, an analyzer + codefix will suggest the relevant changes to the command too, setting/removing the return type as needed (by changing the ICommand or IAsyncCommand as needed, even removing the TResult entirely as needed.

Closes #38

…eversa

The new analyer detects the need for changes in the command definition itself, allowing the command handler to drive changes to it in a more automated fashion, as follows:

* If during the command implementation, you find that the command needs to be made async, you can just change implemented interface in the handler from ICommandHandler > IAsyncCommandHandler and an analyzer + codefix will suggest changing the command from ICommand to IAsyncCommand in turn.
* If during the implementation, you find that you'd like to return a value, or perhaps even change the return type you previously had, an analyzer + codefix will suggest the relevant changes to the command too, setting/removing the return type as needed (by changing the ICommand<TResult> or IAsyncCommand<TResult> as needed, even removing the TResult entirely as needed.

Closes #38
@kzu kzu enabled auto-merge (rebase) November 3, 2022 07:52
@kzu kzu merged commit 4d6dce0 into main Nov 3, 2022
@kzu kzu deleted the feature/handlerfixer branch November 3, 2022 07:56
@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.

Provide analyzer + code fix for turning sync command to async and viceversa
1 participant