Move from 3.9 -> 4.x and EngineContext.Current.ContainerManager

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 năm cách đây
I am in the process of getting a plugin ready for 4.x, previously on 3.9.

One of the changes I see is that we can no longer access EngineContext.Current.ContainerManager, as it has been removed.

My question is this: what is the new equivalent, and more precisely how do I begin/control lifetime scopes in 4.x outside registration time?
6 năm cách đây
It seems the direction is to use the new ServiceProvider, using Engine.Current.ServiceProvider, and from there use CreateScope.

How do I get the original / current scope of a request?
6 năm cách đây
Long live rubber duck debugging. Solved my problem.

For future:

Engine.Current.ServiceProvider.CreateScope().ServiceProvider to get a new service provider in its own scope.
Then just use Engine.Current.ServiceProvider as the original.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.