Adds Generic CommandHandlerDecorator

This commit is contained in:
Janus C. H. Knudsen 2025-03-12 00:13:53 +01:00
parent 49f9b99ee1
commit 64e696dc5a
21 changed files with 131 additions and 110 deletions

View file

@ -1,13 +1,15 @@
namespace PlanTempus.Components;
using PlanTempus.Core.CommandQueries;
namespace PlanTempus.Components;
public interface ICommandHandler
{
Task<TCommandResult> Handle<TCommand, TCommandResult>(TCommand command);
Task<CommandResponse> Handle<TCommand>(TCommand command) where TCommand : ICommand;
}
public interface ICommandHandler<in T, TResult>
public interface ICommandHandler<TCommand> where TCommand : ICommand
{
Task<TResult> Handle(T input);
Task<CommandResponse> Handle(TCommand command);
}
public interface ICommandHandlerDecorator