The command class is annotated with a marker interface that determines if the command is synchronous or asynchronous. This marker interface needs to be kept in sync with the command handler, which must use either ICommandHandler or IAsyncCommandHandler and there's a type constraint on that interface as well to ensure both align.
This makes it cumbersome to turn a sync implementation into async by just changing the command handler interface being implemented from ICommandHandler<T> to IAsyncCommandHandler<T>, since we need to also go to the command T and change the interface there. Since it's the handler the one that drives the implementation/invocation style required of the command, it would be convenient to have an analyzer + codefix that can automatically change the command's interface if we change the implementation (handler) one.
The command class is annotated with a marker interface that determines if the command is synchronous or asynchronous. This marker interface needs to be kept in sync with the command handler, which must use either
ICommandHandlerorIAsyncCommandHandlerand there's a type constraint on that interface as well to ensure both align.This makes it cumbersome to turn a sync implementation into async by just changing the command handler interface being implemented from
ICommandHandler<T>toIAsyncCommandHandler<T>, since we need to also go to the command T and change the interface there. Since it's the handler the one that drives the implementation/invocation style required of the command, it would be convenient to have an analyzer + codefix that can automatically change the command's interface if we change the implementation (handler) one.