From b7c551f1b331c2e3083b933dc45d36fffc2630e8 Mon Sep 17 00:00:00 2001 From: daniel <4954577+jaensen@users.noreply.github.com> Date: Wed, 6 Nov 2024 13:43:45 +0100 Subject: [PATCH] fix: bug in the handling of numeric values in 'In'-filters. --- Circles.Index.Query/FilterPredicate.cs | 10 +++++++++- Circles.Index/Circles.Index.csproj | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Circles.Index.Query/FilterPredicate.cs b/Circles.Index.Query/FilterPredicate.cs index 694f01d..0f67c84 100644 --- a/Circles.Index.Query/FilterPredicate.cs +++ b/Circles.Index.Query/FilterPredicate.cs @@ -48,7 +48,15 @@ private IEnumerable ConvertToEnumerable(object? value) { if (value is JsonElement jsonElement && jsonElement.ValueKind == JsonValueKind.Array) { - return jsonElement.EnumerateArray().Select(v => (object)v.ToString()); + return jsonElement.EnumerateArray().Select(v => + { + if (v.ValueKind == JsonValueKind.Number) + { + return v.GetDouble(); + } + + return (object)v.ToString(); + }); } if (value is IEnumerable e && value is not string) diff --git a/Circles.Index/Circles.Index.csproj b/Circles.Index/Circles.Index.csproj index 6561847..aa37664 100644 --- a/Circles.Index/Circles.Index.csproj +++ b/Circles.Index/Circles.Index.csproj @@ -8,8 +8,8 @@ Daniel Janz (Gnosis Service GmbH) Gnosis Service GmbH Circles - 1.11.1 - 1.11.1 + 1.11.2 + 1.11.2