public void Complete(InterceptArgs e)
		{
			var scopes = ApplicationContext.LocalContext[ObjectInterceptor.ScopesKey] as Stack<ILifetimeScope>;
			var scope = scopes.Pop();
			scope.Dispose();

			if (scopes.Count == 0)
			{
				ApplicationContext.LocalContext.Remove(ObjectInterceptor.ScopesKey);
			}
		}
		public void Initialize(InterceptArgs e)
		{
			Stack<ILifetimeScope> scopes = null;

			if (!ApplicationContext.LocalContext.Contains(ObjectInterceptor.ScopesKey))
			{
				scopes = new Stack<ILifetimeScope>();
				ApplicationContext.LocalContext.Add(ObjectInterceptor.ScopesKey, scopes);
			}
			else
			{
				scopes = ApplicationContext.LocalContext[ObjectInterceptor.ScopesKey] as Stack<ILifetimeScope>;
			}

			var scope = IoC.Container.BeginLifetimeScope();
			scopes.Push(scope);
		}
Example #3
0
 internal void Initialize(InterceptArgs e)
 {
   if (_interceptor != null)
     _interceptor.Initialize(e);
 }
Example #4
0
 internal void Complete(InterceptArgs e)
 {
   if (_interceptor != null)
     _interceptor.Complete(e);
 }