Skip to content

Commit a5bf896

Browse files
committed
Updated IResolverPolicy
1 parent 24c588f commit a5bf896

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
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>2.2.1</Version>
4+
<Version>2.2.2</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/PerThreadLifetimeManager.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace Unity.Lifetime
1616
/// This LifetimeManager does not dispose the instances it holds.
1717
/// </para>
1818
/// </remarks>
19-
public class PerThreadLifetimeManager : LifetimeManager, IResolverPolicy
19+
public class PerThreadLifetimeManager : LifetimeManager
2020
{
2121
[ThreadStatic]
2222
private static Dictionary<Guid, object> _values;
@@ -73,10 +73,5 @@ private static void EnsureValues()
7373
_values = new Dictionary<Guid, object>();
7474
}
7575
}
76-
77-
object IResolverPolicy.Resolve(IBuilderContext _)
78-
{
79-
return GetValue();
80-
}
8176
}
8277
}

src/Policy/IDependencyResolverPolicy.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ namespace Unity.Policy
88
/// A strategy that is used at build plan execution time
99
/// to resolve a dependent value.
1010
/// </summary>
11-
public interface IDependencyResolverPolicy : IResolverPolicy
11+
public interface IDependencyResolverPolicy : IBuilderPolicy
1212
{
13+
/// <summary>
14+
/// GetOrDefault the value
15+
/// </summary>
16+
/// <param name="context">Current build context.</param>
17+
/// <returns>The value for the dependency.</returns>
18+
object Resolve(IBuilderContext context);
1319
}
1420
}

src/Policy/IResolverPolicy.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ namespace Unity.Policy
55
/// <summary>
66
/// A strategy that resolves a value.
77
/// </summary>
8-
public interface IResolverPolicy : IBuilderPolicy
8+
public interface IResolver_Policy : IBuilderPolicy
99
{
1010
/// <summary>
1111
/// GetOrDefault the value
1212
/// </summary>
13-
/// <param name="context">Current build context.</param>
1413
/// <returns>The value for the dependency.</returns>
15-
object Resolve(IBuilderContext context);
14+
object Resolve();
1615
}
1716
}

0 commit comments

Comments
 (0)