I’ve recently updated my definitions for Query Handlers. I’ve changed the original IQuery<Tresult>
to IReturn<TResult>
as, for me, it better reflects the intention of the [marker] interface.
public interface ICommandHandler<TCommand>
{
void Execute(TCommand command);
}
public interface IReturn<TResult>
{
}
public interface IQueryHandler<TQuery, TResult> where TQuery : IReturn<TResult>
{
TResult Execute(TQuery query);
}