private static void SetupContainerOnChildLifetimeScopeBeginning( object sender , LifetimeScopeBeginningEventArgs e ) { var n = Random.Next(1024); Logger.Info($"Child lifetime scope beginning {n}: {e.LifetimeScope.Tag}"); e.LifetimeScope.ChildLifetimeScopeBeginning += SetupContainerOnChildLifetimeScopeBeginning; CurrentLifetimeScope = e.LifetimeScope; }
static void OnScopeStarting(object item, LifetimeScopeBeginningEventArgs args) { var context = ExecutionContext.Capture(); if (ExecutingScopes.ContainsKey(context)) { return; } ExecutingScopes.Add(context, args.LifetimeScope); args.LifetimeScope.CurrentScopeEnding += OnScopeEnding; }
private void OnScopeBeginning(object sender, LifetimeScopeBeginningEventArgs args) { bool isWeb = System.Web.HttpContext.Current != null; Debug.WriteLine("Scope Begin, Web: " + isWeb); }
private static void LifetimeScopeBeginning(object sender, LifetimeScopeBeginningEventArgs e) { e.LifetimeScope.ResolveOperationBeginning += ResolveOperationBeginning; }
private static void LifetimeScopeBeginning(object sender, LifetimeScopeBeginningEventArgs e) { e.LifetimeScope.ResolveOperationBeginning += ResolveOperationBeginning; e.LifetimeScope.ChildLifetimeScopeBeginning += LifetimeScopeBeginning; }
private static void OnScopeStarting(object sender, LifetimeScopeBeginningEventArgs evt) { evt.LifetimeScope.ChildLifetimeScopeBeginning += OnScopeStarting; evt.LifetimeScope.CurrentScopeEnding += OnScopeEnding; // so we can do clean up. }
private void OnChildLifetimeScopeBeginning(object sender, LifetimeScopeBeginningEventArgs e) { ChildLifetimeScopeBeginning?.Invoke(sender, e); }
private void OnChildLifetimeScopeBeginning(LifetimeScopeBeginningEventArgs e) { ChildLifetimeScopeBeginning?.Invoke(this, e); }