2025-03-10 18:10:00 +01:00
|
|
|
using Autofac;
|
2025-03-12 00:13:53 +01:00
|
|
|
using PlanTempus.Core.CommandQueries;
|
2025-03-10 18:10:00 +01:00
|
|
|
|
|
|
|
|
namespace PlanTempus.Components;
|
|
|
|
|
|
|
|
|
|
public class CommandHandler(IComponentContext context) : ICommandHandler
|
|
|
|
|
{
|
2025-03-12 00:13:53 +01:00
|
|
|
public async Task<CommandResponse> Handle<TCommand>(TCommand command) where TCommand : ICommand
|
2025-03-10 18:10:00 +01:00
|
|
|
{
|
2025-03-12 00:13:53 +01:00
|
|
|
var handler = context.Resolve<ICommandHandler<TCommand>>();
|
2025-03-11 00:28:06 +01:00
|
|
|
return await handler.Handle(command);
|
2025-03-10 18:10:00 +01:00
|
|
|
}
|
|
|
|
|
}
|