Example #1
0
        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);
        }
Example #2
0
 public static void BeginNewLifetimeScope()
 {
     CurrentScope.Dispose();
     CurrentScope = _lifetime.BeginLifetimeScope();
 }
Example #3
0
 public void Dispose()
 {
     CurrentScope?.Dispose();
 }
Example #4
0
 public static void EndSessionScope()
 {
     Log.Info().Message("Ending session scope {scope}", CurrentScope).Write();
     CurrentScope?.Dispose();
     CurrentScope = null;
 }