Is your feature request related to a problem? Please describe.
The existing ICommand interface forces every command to specify a return type, even for operations that conceptually do not produce one — for example:
public class DeletePortalCommand : ICommand<Unit>
{
public Guid PortalId { get; set; }
}
Using Unit as a workaround feels less natural and slightly verbose.
In our CQRS implementation, commands that mutate state usually do not return results — they raise events most of the time.
Describe the solution you'd like
Currently, all commands in the Cortex Mediator library implement the generic interface ICommand, which implies that every command must return a value.
I’d like to request the addition of a non-generic ICommand interface for commands that do not return a result.
Describe alternatives you've considered
Currently considering moving away from MediatR due to compliance requirements.
As part of this transition, we are evaluating alternative mediator libraries that provide similar functionality and structure, with minimal impact on our existing codebase. The goal is to find (or adapt) a solution that allows us to migrate from MediatR with as little refactoring as possible, maintaining the same CQRS and mediator patterns that our system already relies on.
Thank you for your work on Cortex.Mediator and OS.
Is your feature request related to a problem? Please describe.
The existing ICommand interface forces every command to specify a return type, even for operations that conceptually do not produce one — for example:
Using Unit as a workaround feels less natural and slightly verbose.
In our CQRS implementation, commands that mutate state usually do not return results — they raise events most of the time.
Describe the solution you'd like
Currently, all commands in the Cortex Mediator library implement the generic interface ICommand, which implies that every command must return a value.
I’d like to request the addition of a non-generic ICommand interface for commands that do not return a result.
Describe alternatives you've considered
Currently considering moving away from MediatR due to compliance requirements.
As part of this transition, we are evaluating alternative mediator libraries that provide similar functionality and structure, with minimal impact on our existing codebase. The goal is to find (or adapt) a solution that allows us to migrate from MediatR with as little refactoring as possible, maintaining the same CQRS and mediator patterns that our system already relies on.
Thank you for your work on Cortex.Mediator and OS.