Skip to content

Commit

Permalink
Refactoring lifetime managers
Browse files Browse the repository at this point in the history
  • Loading branch information
ENikS committed Jun 8, 2019
1 parent cdcea01 commit d1cad8f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/Lifetime/Managers/ContainerControlledLifetimeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ public ContainerControlledLifetimeManager()
#endregion


#region Scope

public object Scope { get; internal set; }

#endregion


#region SynchronizedLifetimeManager

/// <inheritdoc/>
Expand Down Expand Up @@ -82,7 +89,10 @@ public override void SetValue(object newValue, ILifetimeContainer container = nu
/// <inheritdoc/>
protected override LifetimeManager OnCreateLifetimeManager()
{
return new ContainerControlledLifetimeManager();
return new ContainerControlledLifetimeManager
{
Scope = Scope
};
}

#endregion
Expand Down
2 changes: 1 addition & 1 deletion src/Lifetime/Managers/TransientLifetimeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class TransientLifetimeManager : LifetimeManager,
public override bool InUse { get => false; set { } }

/// <inheritdoc/>
protected override LifetimeManager OnCreateLifetimeManager() => Instance;
protected override LifetimeManager OnCreateLifetimeManager() => new TransientLifetimeManager();

/// <summary>
/// This method provides human readable representation of the lifetime
Expand Down

0 comments on commit d1cad8f

Please sign in to comment.