This is a fairly straight forward decorator pattern scenario, with the complication that the decorated type has a constructor parameter that is dependent on the type into which
Have you ever thought about basing your decorators on the Unity Interception functionality? Then it would be really easy to say "intercept the calls to IThing
using this Interceptor" just once.
container.AddNewExtension();
container.RegisterType(new Interceptor(), new InterceptionBehavior());
and then it would be "inject this IThing
into this and that Depender
"
container.RegisterType(new InjectionConstructor(new ResolvedParameter("myNameForThing")));