This commit is contained in:
Janus C. H. Knudsen 2025-03-10 15:56:22 +01:00
parent f3ab94eff1
commit 31666b4ba0
34 changed files with 140 additions and 83 deletions

View file

@ -0,0 +1,24 @@
using Autofac;
using PlanTempus.Core.SeqLogging;
namespace PlanTempus.Components.ModuleRegistry
{
public class CommandModule : Module
{
// public required SeqConfiguration SeqConfiguration { get; set; }
protected override void Load(ContainerBuilder builder)
{
// Registrer alle handlers
builder.RegisterAssemblyTypes()
.AsClosedTypesOf(typeof(ICommandHandler<>))
.InstancePerLifetimeScope();
// Registrer en decorator for alle ICommandHandler<TCommand>
builder.RegisterGenericDecorator(
typeof(LoggingCommandHandlerDecorator<>), // Din decorator-klasse
typeof(ICommandHandler<>)); // Interface, der skal dekoreres
}
}
}