You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
added a commit
that referenced
this issue
Nov 2, 2022
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
Detect return type mismatch when implementing command handlers.
The text was updated successfully, but these errors were encountered: