From a08d06b6873b3946c1aa28200d36354423e1bb20 Mon Sep 17 00:00:00 2001 From: jung Date: Sun, 23 Jul 2023 18:00:03 +0200 Subject: [PATCH] devexteme array any --- Core.Arango.DevExtreme/ArangoTransform.cs | 10 +++++++++- Core.Arango.DevExtreme/ArangoTransformSettings.cs | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Core.Arango.DevExtreme/ArangoTransform.cs b/Core.Arango.DevExtreme/ArangoTransform.cs index 6e4544c..4f9eaab 100644 --- a/Core.Arango.DevExtreme/ArangoTransform.cs +++ b/Core.Arango.DevExtreme/ArangoTransform.cs @@ -2,6 +2,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using System.Security.Principal; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -628,7 +629,7 @@ private string GetMatchingFilter(IList dxFilter, bool not = false) case "endswith": opString = "ENDSWITH"; break; - case "in": + case "in": // TODO: deprecated opString = "IN"; break; default: @@ -654,6 +655,12 @@ private string GetMatchingFilter(IList dxFilter, bool not = false) var realPropertyName = _settings.ValidPropertyName(dxFilter[0].ToString()).FirstCharOfPropertiesToUpper(); + if (_settings.ArrayProperties.Contains(realPropertyName)) + { + if (opString == "==") + opString = "ANY =="; + } + string property; if (_settings.ExtractFilters.TryGetValue(realPropertyName, out var extract1)) @@ -661,6 +668,7 @@ private string GetMatchingFilter(IList dxFilter, bool not = false) else property = PropertyName(realPropertyName); + string boundParam = null; diff --git a/Core.Arango.DevExtreme/ArangoTransformSettings.cs b/Core.Arango.DevExtreme/ArangoTransformSettings.cs index 70842fb..e2c03a6 100644 --- a/Core.Arango.DevExtreme/ArangoTransformSettings.cs +++ b/Core.Arango.DevExtreme/ArangoTransformSettings.cs @@ -104,6 +104,8 @@ public class ArangoTransformSettings /// public Func PropertyTransform { get; set; } + public HashSet ArrayProperties { get; set; } = new(); + /// /// When true (default) always sort by _key last if not already present ///