diff --git a/src/Lifetime/Managers/ContainerControlledLifetimeManager.cs b/src/Lifetime/Managers/ContainerControlledLifetimeManager.cs index 91096822..5570a86f 100644 --- a/src/Lifetime/Managers/ContainerControlledLifetimeManager.cs +++ b/src/Lifetime/Managers/ContainerControlledLifetimeManager.cs @@ -48,6 +48,13 @@ public ContainerControlledLifetimeManager() #endregion + #region Scope + + public object Scope { get; internal set; } + + #endregion + + #region SynchronizedLifetimeManager /// @@ -82,7 +89,10 @@ public override void SetValue(object newValue, ILifetimeContainer container = nu /// protected override LifetimeManager OnCreateLifetimeManager() { - return new ContainerControlledLifetimeManager(); + return new ContainerControlledLifetimeManager + { + Scope = Scope + }; } #endregion diff --git a/src/Lifetime/Managers/TransientLifetimeManager.cs b/src/Lifetime/Managers/TransientLifetimeManager.cs index 45821559..2f653928 100644 --- a/src/Lifetime/Managers/TransientLifetimeManager.cs +++ b/src/Lifetime/Managers/TransientLifetimeManager.cs @@ -34,7 +34,7 @@ public class TransientLifetimeManager : LifetimeManager, public override bool InUse { get => false; set { } } /// - protected override LifetimeManager OnCreateLifetimeManager() => Instance; + protected override LifetimeManager OnCreateLifetimeManager() => new TransientLifetimeManager(); /// /// This method provides human readable representation of the lifetime