Reputation: 15179
I need to translate the following Unity snippet to Autofac implementation:
container.RegisterType<IMyThing>(
new TransientLifetimeManager(),
new InjectionFactory(c => c.Resolve<IMyThingProvider>().GetTheThing()));
What's the equivalent of InjectionFactory?
Upvotes: 0
Views: 357
Reputation: 36513
I believe you want to use a lambda registration:
container.Register(ctxt => ctxt.Resolve<IMyThingProvider>().GetTheThing())
.As<IMyThing>();
Upvotes: 4