As I understand IContainerBuilder passed to LifetimeScope.Enqueue just adds registrations to each LifetimeScope in scene. So
using (Enqueue(
builder =>
{
builder.Register<UniqueContext>(Lifetime.Singleton); // this is not Singleton for scene or prefab which context would to register
builder.RegisterBuildCallback(c => Debug.Log("Extra scope container is ready")); // It executes every time for each scope in scene or prefab
}
))
works right if loaded scene or created prefab contain only one scope.
Is it possible to make alternate Enqueue method which creates super-scope with passed builder?
Also it would be convenient to have ability to alternate IObjectResolver and LifetimeScope in hierarchy.
As I understand IContainerBuilder passed to LifetimeScope.Enqueue just adds registrations to each LifetimeScope in scene. So
works right if loaded scene or created prefab contain only one scope.
Is it possible to make alternate Enqueue method which creates super-scope with passed builder?
Also it would be convenient to have ability to alternate IObjectResolver and LifetimeScope in hierarchy.