Threading and LifetimeScope in nopCommerce 4.00

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
Hello everyone,
we are currently upgrading our plugin from nopCommerce version 3.80 and 4.00. We have one function, that needs to run in Thread (data transfer from/to our ERP).

In 3.80 we used:
 
using (var scope = EngineContext.Current.ContainerManager.Container.BeginLifetimeScope())
{
...
}


In 4.00 is missing EngineContext.Current.ContainerManager, so i tried to inject ILifetimeScope, but it fails, when you use EngineContext.Current.Resolve<TService>, GetServiceProvider() returns null. When i don't use ILifetimeScope, it offen fails in DbContext has been disposed exception.

Some advices, how correctly use threads?

Thanks Martin.
5 years ago
Taking back #2750.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.