By default the dispatcher resolves the registered ICommandHandler<> for the command type. You can bypass that and supply a delegate yourself when you need to — for example, to call a domain service directly, to compose existing handlers, or in test code.
Pass a delegate as the second argument to Send or SendAndPublish:
var result = await dispatcher.Send(
command,
() => _somethingService.DoSomethingAsync(command));
var result = await dispatcher.SendAndPublish(
command,
() => _somethingService.DoSomethingAndPublishAsync(command));
The delegate’s return type must match what the registered handler would return — Task<Result> for ICommand, Task<Result<TResponse>> for ICommand<TResponse>.
For everything else, the standard ICommandHandler<> discovered by AddMemoria is the right choice.