Browse Source

CORE - Fixed LinkedProperty bug causing issues with autopopulation of dimensions on various screens (added Type to equality comparer when registering linked properties)

Nick-PRSDigital@bitbucket.org 2 years ago
parent
commit
58a6be1b98
1 changed files with 8 additions and 1 deletions
  1. 8 1
      InABox.Core/LinkedProperty.cs

+ 8 - 1
InABox.Core/LinkedProperty.cs

@@ -11,6 +11,12 @@ namespace InABox.Core
         String Source { get; }
         String Target { get; }
         void Update(object? from, object? to);
+
+        /// <summary>
+        /// This equality comparer checks against type, path, source and target
+        /// </summary>
+        /// <param name="obj"></param>
+        /// <returns></returns>
         bool Equals(object obj);
     }
 
@@ -44,7 +50,8 @@ namespace InABox.Core
             if (obj is ILinkedProperty src)
             {
                 return 
-                    String.Equals(src.Path,Path)
+                    (obj as ILinkedProperty).Type == Type &&
+                        String.Equals(src.Path,Path)
                        && String.Equals(src.Source, Source)
                        && String.Equals(src.Target, Target);
             }