Beispiel #1
0
 public LifetimeScope()
 {
     LifetimeScopeStore.Get <TContext>().OpenScope();
 }
 public override object Resolve(CreationContext context)
 {
     return(LifetimeScopeStore.Get <TContext>()
            .GetOrAdd(this, lifestyleManager => new ComponentInstance(lifestyleManager, base.Resolve(context)))
            .Instance);
 }
Beispiel #3
0
 public void Dispose()
 {
     LifetimeScopeStore.Get <TContext>().CloseScope();
 }
 public override bool Release(object instance)
 {
     LifetimeScopeStore.Get <TContext>().TryRemove(this);
     return(base.Release(instance));
 }