Skip to content

Commit 0d9a025

Browse files
committed
Revert "Update TransientLifetimeManager.cs"
This reverts commit ca2f7e9.
1 parent 85a13f4 commit 0d9a025

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

src/Lifetime/ContainerControlledTransientManager.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ public override object GetValue(ILifetimeContainer container = null)
2020
return null;
2121
}
2222

23+
public override void RemoveValue(ILifetimeContainer container = null)
24+
{
25+
}
26+
2327
protected override LifetimeManager OnCreateLifetimeManager()
2428
{
2529
return this;

src/Lifetime/ExternallyControlledLifetimeManager.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ public override void SetValue(object newValue, ILifetimeContainer container = nu
3232
_value = new WeakReference(newValue);
3333
}
3434

35+
/// <summary>
36+
/// Remove the given object from backing store.
37+
/// </summary>
38+
/// <param name="container">Instance of container</param>
39+
public override void RemoveValue(ILifetimeContainer container = null)
40+
{
41+
// DO NOTHING - we don't own this instance.
42+
}
43+
44+
3545
protected override LifetimeManager OnCreateLifetimeManager()
3646
{
3747
return new ExternallyControlledLifetimeManager();

src/Lifetime/TransientLifetimeManager.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,23 @@ public override object GetValue(ILifetimeContainer container = null)
2626
return null;
2727
}
2828

29+
/// <summary>
30+
/// Stores the given value into backing store for retrieval later.
31+
/// </summary>
32+
/// <param name="newValue">The object being stored.</param>
33+
/// <param name="container">Instance of container which owns the value</param>
34+
public override void SetValue(object newValue, ILifetimeContainer container = null)
35+
{
36+
}
37+
38+
/// <summary>
39+
/// Remove the given object from backing store.
40+
/// <param name="container">Instance of container</param>
41+
/// </summary>
42+
public override void RemoveValue(ILifetimeContainer container = null)
43+
{
44+
}
45+
2946
protected override LifetimeManager OnCreateLifetimeManager()
3047
{
3148
return Instance;

0 commit comments

Comments
 (0)