From d51f26534326cc1fce474f7583fb90093efbe931 Mon Sep 17 00:00:00 2001 From: Eugene Sadovoi Date: Fri, 1 Mar 2019 21:19:35 -0500 Subject: [PATCH] Removed ValueTuple dependency --- .../Resolution/Overrides/DependencyOverride.cs | 8 ++++---- src/Resolution/NamedType.cs | 12 ++++++++++++ src/Unity.Abstractions.csproj | 5 ----- 3 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 src/Resolution/NamedType.cs diff --git a/src/Dependency/Resolution/Overrides/DependencyOverride.cs b/src/Dependency/Resolution/Overrides/DependencyOverride.cs index 68d8895c..6b582948 100644 --- a/src/Dependency/Resolution/Overrides/DependencyOverride.cs +++ b/src/Dependency/Resolution/Overrides/DependencyOverride.cs @@ -9,7 +9,7 @@ namespace Unity.Resolution /// given type, regardless of where it appears in the object graph. /// public class DependencyOverride : ResolverOverride, - IEquatable<(Type,string)>, + IEquatable, IEquatable, IEquatable, IEquatable, @@ -69,10 +69,10 @@ public override bool Equals(object obj) return false; } - public bool Equals((Type, string) other) + public bool Equals(NamedType other) { - return (null == Type || other.Item1 == Type) && - (null == Name || other.Item2 == Name); + return (null == Type || other.Type == Type) && + (null == Name || other.Name == Name); } public bool Equals(FieldInfo other) diff --git a/src/Resolution/NamedType.cs b/src/Resolution/NamedType.cs new file mode 100644 index 00000000..d797c912 --- /dev/null +++ b/src/Resolution/NamedType.cs @@ -0,0 +1,12 @@ +using System; + +namespace Unity.Resolution +{ + public struct NamedType + { + public Type Type; + public string Name; + + public override int GetHashCode() => ((Type?.GetHashCode() ?? 0) + 37) ^ ((Name?.GetHashCode() ?? 0) + 17); + } +} diff --git a/src/Unity.Abstractions.csproj b/src/Unity.Abstractions.csproj index f304b80c..3e8a1f0b 100644 --- a/src/Unity.Abstractions.csproj +++ b/src/Unity.Abstractions.csproj @@ -50,10 +50,6 @@ Full - - - - true @@ -66,7 +62,6 @@ all runtime; build; native; contentfiles; analyzers -