I was wondering how do I achieve such a feature in the UnityContainer:
container.RegisterType<IDummy>(Func<IDummy>) // deferred resolution
I was wondering how do I achieve such a feature in the UnityContainer:
container.RegisterType<IDummy>(Func<IDummy>) // deferred resolution
If you're going to register factory instead of instance, try this:
container.RegisterType<IDummy>(new InjectionFactory(context => new Dummy()));
Just replace "context => new Dummy()" with your lambda.