Skip to content

Commit

Permalink
imp - Value equality added to ValueInfo Equals()
Browse files Browse the repository at this point in the history
---

We've added value equality to ValueInfo Equals() function.

---

Type: imp
Breaking: False
Doc Required: False
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Nov 9, 2024
1 parent 949bffd commit 627e564
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions VisualCard/Parts/ValueInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,16 @@ public bool Equals(ValueInfo<TValue> source, ValueInfo<TValue> 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
;
}

Expand Down Expand Up @@ -146,9 +150,6 @@ public override int GetHashCode()
public static bool operator !=(ValueInfo<TValue> left, ValueInfo<TValue> right) =>
!(left == right);

internal bool EqualsInternal(ValueInfo<TValue> source, ValueInfo<TValue> target) =>
true;

internal ValueInfo(PropertyInfo? property, int altId, string[] elementTypes, string valueType, TValue? value)
{
Property = property;
Expand Down

0 comments on commit 627e564

Please sign in to comment.