using Autofac; using PlanTempus.Components.Users.Create; using PlanTempus.Core.CommandQueries; using PlanTempus.Core.SeqLogging; namespace PlanTempus.Components.ModuleRegistry { public class CommandModule : Module { // public required SeqConfiguration SeqConfiguration { get; set; } protected override void Load(ContainerBuilder builder) { builder.RegisterType() .As() .InstancePerLifetimeScope(); builder.RegisterAssemblyTypes(ThisAssembly) .Where(t => !typeof(ICommandHandlerDecorator).IsAssignableFrom(t)) .AsClosedTypesOf(typeof(ICommandHandler<>)) .InstancePerLifetimeScope(); builder.RegisterAssemblyTypes(ThisAssembly) .As(); builder.RegisterGenericDecorator( typeof(CommandHandlerDecorator<>), typeof(ICommandHandler<>)); // // Registrer en decorator for alle ICommandHandler // builder.RegisterGenericDecorator( // typeof(CommandHandlerDecorator<,>), // typeof(ICommandHandler<,>)); } } }