How to deal with run-time parameters when using lifetime scoping?
Autofac now supports this out of the box with an extension to the lifetime scopes. The BeginLifetimeScope() method has an overload that takes an Action<ContainerBuilder> that allows for adding new registrations specific to only that lifetime scope. So for the given example it would look something like: var builder = new ContainerBuilder(); builder.RegisterType<MyService>().As<IMyService>().InstancePerLifetimeScope(); var container … Read more