diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-07-27 07:46:38 -0500 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2021-07-27 07:46:38 -0500 |
| commit | 281da1abdb3e8496142a37dcff57376e9672cf31 (patch) | |
| tree | 3c35536e648c4faf74d510f57bb0072915846482 /src | |
| parent | 742c8c8a77d28eccda886f0e6ca15d4a05a3cf4d (diff) | |
| download | slskd-281da1abdb3e8496142a37dcff57376e9672cf31.tar.gz | |
handle arrays in DiffWith (#129)
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Common/Extensions.cs | 9 |
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)) { |
