Skip to content

Commit 33a399d

Browse files
committed
Modifying DependencyOverride behavior
1 parent 4d0b99d commit 33a399d

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

src/Dependency/Resolution/Overrides/DependencyOverride.cs

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Reflection;
32

43
namespace Unity.Resolution
54
{
@@ -10,9 +9,6 @@ namespace Unity.Resolution
109
/// </summary>
1110
public class DependencyOverride : ResolverOverride,
1211
IEquatable<NamedType>,
13-
IEquatable<FieldInfo>,
14-
IEquatable<PropertyInfo>,
15-
IEquatable<ParameterInfo>,
1612
IResolve
1713
{
1814
#region Fields
@@ -71,26 +67,8 @@ public override bool Equals(object obj)
7167

7268
public bool Equals(NamedType other)
7369
{
74-
return (null == Type || other.Type == Type) &&
75-
(null == Name || other.Name == Name);
76-
}
77-
78-
public bool Equals(FieldInfo other)
79-
{
80-
return (null == Type || other.FieldType == Type) &&
81-
(null == Name || other.Name == Name);
82-
}
83-
84-
public bool Equals(PropertyInfo other)
85-
{
86-
return (null == Type || other.PropertyType == Type) &&
87-
(null == Name || other.Name == Name);
88-
}
89-
90-
public bool Equals(ParameterInfo other)
91-
{
92-
return (null == Type || other.ParameterType == Type) &&
93-
(null == Name || other.Name == Name);
70+
return (other.Type == Type) &&
71+
(other.Name == Name);
9472
}
9573

9674
#endregion

0 commit comments

Comments
 (0)