Skip to content

Commit 5e5740f

Browse files
committed
Releasing v3.2.0
1 parent 0d9a025 commit 5e5740f

7 files changed

+9
-57
lines changed

package.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22

33
<PropertyGroup>
4-
<Version>3.1.3</Version>
4+
<Version>3.2.0</Version>
55
<PackageReleaseNotes>This package is distributed as .NET Standard 1.0, 2.0, .Net Core 1.0 and .NET 4.0, 4.5, 4.7</PackageReleaseNotes>
66
</PropertyGroup>
77

src/Lifetime/ExternallyControlledLifetimeManager.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,6 @@ 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-
4535
protected override LifetimeManager OnCreateLifetimeManager()
4636
{
4737
return new ExternallyControlledLifetimeManager();

src/Lifetime/ILifetimeContainer.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ namespace Unity.Lifetime
1515
/// </remarks>
1616
public interface ILifetimeContainer : IEnumerable<object>, IDisposable
1717
{
18+
/// <summary>
19+
/// The container that this context is associated with.
20+
/// </summary>
21+
/// <value>The <see cref="IUnityContainer"/> object.</value>
22+
IUnityContainer Container { get; }
23+
1824
/// <summary>
1925
/// Gets the number of references in the lifetime container
2026
/// </summary>

src/Lifetime/LifetimeManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ public abstract class LifetimeManager : ILifetimePolicy, ILifetimeFactoryPolicy
2626
/// </summary>
2727
/// <param name="newValue">The object being stored.</param>
2828
/// <param name="container">The container this lifetime belongs to</param>
29-
public abstract void SetValue(object newValue, ILifetimeContainer container = null);
29+
public virtual void SetValue(object newValue, ILifetimeContainer container = null) { }
3030

3131
/// <summary>
3232
/// Remove the given object from backing store.
3333
/// <param name="container">The container this lifetime belongs to</param>
3434
/// </summary>
35-
public abstract void RemoveValue(ILifetimeContainer container = null);
35+
public virtual void RemoveValue(ILifetimeContainer container = null) { }
3636

3737
#endregion
3838

src/Lifetime/PerResolveLifetimeManager.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,6 @@ public override object GetValue(ILifetimeContainer container = null)
3232
return value;
3333
}
3434

35-
/// <summary>
36-
/// Stores the given value into backing store for retrieval later. In this class,
37-
/// this is a noop, since it has special hooks down in the guts.
38-
/// </summary>
39-
/// <param name="container">Instance of container which owns the value</param>
40-
/// <param name="newValue">The object being stored.</param>
41-
public override void SetValue(object newValue, ILifetimeContainer container = null)
42-
{
43-
}
44-
45-
/// <summary>
46-
/// Remove the given object from backing store. Noop in this class.
47-
/// </summary>
48-
/// <param name="container">Instance of container</param>
49-
public override void RemoveValue(ILifetimeContainer container = null)
50-
{
51-
}
52-
5335
protected override LifetimeManager OnCreateLifetimeManager()
5436
{
5537
return new PerResolveLifetimeManager();

src/Lifetime/PerThreadLifetimeManager.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,6 @@ public override void SetValue(object newValue, ILifetimeContainer container = nu
5757
_values[_key] = newValue;
5858
}
5959

60-
/// <summary>
61-
/// Remove the given object from backing store.
62-
/// </summary>
63-
/// <param name="container">Instance of container</param>
64-
/// <remarks>Not implemented for this lifetime manager.</remarks>
65-
public override void RemoveValue(ILifetimeContainer container = null)
66-
{
67-
}
68-
6960
private static void EnsureValues()
7061
{
7162
// no need for locking, values is TLS

src/Lifetime/TransientLifetimeManager.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,6 @@ 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-
4629
protected override LifetimeManager OnCreateLifetimeManager()
4730
{
4831
return Instance;

0 commit comments

Comments
 (0)