wip
This commit is contained in:
parent
f3ab94eff1
commit
31666b4ba0
34 changed files with 140 additions and 83 deletions
24
PlanTempus.Components/ModuleRegistry/SeqLoggingModule.cs
Normal file
24
PlanTempus.Components/ModuleRegistry/SeqLoggingModule.cs
Normal 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
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue