aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2021-07-27 07:46:38 -0500
committerJP Dillingham <jpdillingham@gmail.com>2021-07-27 07:46:38 -0500
commit281da1abdb3e8496142a37dcff57376e9672cf31 (patch)
tree3c35536e648c4faf74d510f57bb0072915846482
parent742c8c8a77d28eccda886f0e6ca15d4a05a3cf4d (diff)
downloadslskd-281da1abdb3e8496142a37dcff57376e9672cf31.tar.gz
handle arrays in DiffWith (#129)
-rw-r--r--src/slskd/Common/Extensions.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/slskd/Common/Extensions.cs b/src/slskd/Common/Extensions.cs
index 33faecf7..51c0d147 100644
--- a/src/slskd/Common/Extensions.cs
+++ b/src/slskd/Common/Extensions.cs
@@ -91,7 +91,14 @@ namespace slskd
var propType = prop.PropertyType;
var fqn = string.IsNullOrEmpty(parentFqn) ? prop.Name : string.Join(".", parentFqn, prop.Name);
- if (propType.IsPrimitive || Nullable.GetUnderlyingType(propType) != null || new[] { typeof(string), typeof(decimal) }.Contains(propType))
+ if (propType.IsArray)
+ {
+ if (leftVal.ToJson() != rightVal.ToJson())
+ {
+ differences.Add((prop, fqn, leftVal, rightVal));
+ }
+ }
+ else if (propType.IsPrimitive || Nullable.GetUnderlyingType(propType) != null || new[] { typeof(string), typeof(decimal) }.Contains(propType))
{
if (!Equals(leftVal, rightVal))
{