Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
        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;
 }
Exemplo n.º 5
0
 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);
 }
Exemplo n.º 8
0
 private void OnChildLifetimeScopeBeginning(LifetimeScopeBeginningEventArgs e)
 {
     ChildLifetimeScopeBeginning?.Invoke(this, e);
 }
 private void OnChildLifetimeScopeBeginning(LifetimeScopeBeginningEventArgs e)
 {
     ChildLifetimeScopeBeginning?.Invoke(this, e);
 }