using Autofac;
using PlanTempus.Core.CommandQueries;

namespace PlanTempus.Components;

public class CommandHandler(IComponentContext context) : ICommandHandler
{
    public async Task<CommandResponse> Handle<TCommand>(TCommand command) where TCommand : ICommand
    {
        var handler = context.Resolve<ICommandHandler<TCommand>>();
        return await handler.Handle(command);
    }
}