public IScenario SetScenario(string scenarioTag) { CurrentScope?.Dispose(); CurrentScope = null; var scenario = _container.CurrentContainer.ResolveKeyed <IScenario>(scenarioTag); Scenario = scenario; var scope = _container.CurrentContainer.BeginLifetimeScope(scenario.Info.Symbol, builder => { scenario.Register(builder); }); _container.CurrentScope = scope; return(Scenario); }
public static void BeginNewLifetimeScope() { CurrentScope.Dispose(); CurrentScope = _lifetime.BeginLifetimeScope(); }
public void Dispose() { CurrentScope?.Dispose(); }
public static void EndSessionScope() { Log.Info().Message("Ending session scope {scope}", CurrentScope).Write(); CurrentScope?.Dispose(); CurrentScope = null; }