diff --git a/src/Umbraco.Core/Models/Property.cs b/src/Umbraco.Core/Models/Property.cs
index 76349823ac..f51f70faf6 100644
--- a/src/Umbraco.Core/Models/Property.cs
+++ b/src/Umbraco.Core/Models/Property.cs
@@ -50,7 +50,7 @@ namespace Umbraco.Core.Models
///
/// Represents a property value.
///
- public class PropertyValue
+ public class PropertyValue : IEquatable
{
// TODO: Either we allow change tracking at this class level, or we add some special change tracking collections to the Property
// class to deal with change tracking which variants have changed
@@ -95,6 +95,26 @@ namespace Umbraco.Core.Models
///
public PropertyValue Clone()
=> new PropertyValue { _culture = _culture, _segment = _segment, PublishedValue = PublishedValue, EditedValue = EditedValue };
+
+ public override bool Equals(object obj)
+ {
+ return Equals(obj as PropertyValue);
+ }
+
+ public bool Equals(PropertyValue other)
+ {
+ return other != null &&
+ _culture == other._culture &&
+ _segment == other._segment;
+ }
+
+ public override int GetHashCode()
+ {
+ var hashCode = -1254204277;
+ hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(_culture);
+ hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(_segment);
+ return hashCode;
+ }
}
private static readonly DelegateEqualityComparer