From 627e564abeb7214f2903c4f8478ee8d6b8a51864 Mon Sep 17 00:00:00 2001 From: Aptivi CEO Date: Sat, 9 Nov 2024 09:54:28 +0300 Subject: [PATCH] imp - Value equality added to ValueInfo Equals() --- We've added value equality to ValueInfo Equals() function. --- Type: imp Breaking: False Doc Required: False Backport Required: False Part: 1/1 --- VisualCard/Parts/ValueInfo.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/VisualCard/Parts/ValueInfo.cs b/VisualCard/Parts/ValueInfo.cs index 338268e..ba814c7 100644 --- a/VisualCard/Parts/ValueInfo.cs +++ b/VisualCard/Parts/ValueInfo.cs @@ -112,12 +112,16 @@ public bool Equals(ValueInfo source, ValueInfo target) // Check all the properties return + source.Property is not null && + target.Property is not null && + source.Value is not null && + target.Value is not null && source.Property == target.Property && source.ElementTypes.SequenceEqual(target.ElementTypes) && source.AltId == target.AltId && + source.Value.Equals(target.Value) && source.ValueType == target.ValueType && - source.Group == target.Group && - EqualsInternal(source, target) + source.Group == target.Group ; } @@ -146,9 +150,6 @@ public override int GetHashCode() public static bool operator !=(ValueInfo left, ValueInfo right) => !(left == right); - internal bool EqualsInternal(ValueInfo source, ValueInfo target) => - true; - internal ValueInfo(PropertyInfo? property, int altId, string[] elementTypes, string valueType, TValue? value) { Property = property;