Then you create auxiliary extension methods that allow you to easily add Query and Command classes that implement these interfaces to Dependency injection container
Here is the code for AddCommandHandler extension method
Here is the code for AddQueryHandler extension method
We stick to the convention that commands don't return anything. You may not like it ¯\_(ツ)_/¯
Queries obviously return something, so the code for this extension method and interface IQueryHandler is a little different