Hi,
Currently we have ICommandHandlers implementations which we register keybased. Like
containerBuilder.RegisterType(commandHandlerType)
.Keyed<ICommandHandler>(commandType);
Next we have a factory function which is registered like this:
containerBuilder.Register<Func<ICommand, Owned<ICommandHandler>>>(c =>
{
var context = c.Resolve<IComponentContext>();
return command => context.IsRegisteredWithKey<Owned<ICommandHandler>>(command.GetType())
? context.ResolveKeyed<Owned<ICommandHandler>>(command.GetType())
: null;
});
Now, if we want to use the decorator functionality (
http://docs.autofac.org/en/latest/advanced/adapters-decorators.html#decorators) in autofac to add for example transactionsupport or anything else which can be done using a decorator...
How can be perform this without changing the signature of our factory function (we want to keep Func<ICommand, Owned<ICommandHandler>?
Thanks on advance