Working on a command dispatcher
This commit is contained in:
parent
31666b4ba0
commit
a86a2d7ade
5 changed files with 55 additions and 4 deletions
|
|
@ -1,24 +0,0 @@
|
|||
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